virtual-memory

process's virtual memory size on different machines

Does virtual memory of process can have different size on different machines (CPU, memory)? The process does the same job on both machines. The platform is RHEL 5.3 (kernel 2.6.18) and the process is C++ compiled by gcc (4.1.2). ...

Exploring Virtual Memory (ProcessWalker)

I was reading this article on MSDN "Managing Heap Memory in Win32" And in it they are explaining about a tool called ProcessWalker.exe In the article they explained that they can use this tool to explore the contents of virtual memory of any process. Does anyone know where I can download this tool from. Or maybe ProcessWalker might b...

Getting the lowest free virtual memory address in windows.

Title says it pretty much all : is there a way to get the lowest free virtual memory address under windows ? I should add that I am interested by this information at the beginning of the program (before any dynamic memory allocation has been done). Why I need it : trying to build a malloc implementation under Windows. If it is not possi...

Limiting resident memory usage

I would like to limit the amount of physical memory a process can use without limiting the amount of virtual memory it can use. I am doing this in an effort to measure the behavior of various algorithms under memory pressure, and I need to test their performance with many different amounts of physical memory available - so I either need...

Allocating largest buffer without using swap

In C/C++ under Linux, I need to allocate a large (several gigabyte) block of memory, in order to store real-time data from a sensor connected to the ethernet port and streaming data at about 110MB/s. I'd like to allocate the largest amount of memory possible, to maximise the length of data sequence that I can store. However, I also need ...

what could be reason for virtual bytes to grow 2x private bytes?

An application's virtual bytes grow 2-times the private bytes. does this indicate memory leak? bad application design? OS is 32Bit any thoughts are welcome. application is stream database. ...

Which (OS X) dtrace probe fires when a page is faulted in from disk?

I'm writing up a document about page faulting and am trying to get some concrete numbers to work with, so I wrote up a simple program that reads 12*1024*1024 bytes of data. Easy: int main() { FILE*in = fopen("data.bin", "rb"); int i; int total=0; for(i=0; i<1024*1024*12; i++) total += fgetc(in); printf("%d\n", total); } ...

Experts - GCC and ld linker : re-initialization of variables contained in .data section?

In an C program, I need to re-initialize all global variables as they where when the program starts for tests purpose. I want to reproduce the data copy from Load Memory Address, LMA to VMA (run-time address) done by GCC libraries with a reinitialization function. For example, if foo variables are declared as global and initialized. And...

C++ App Exceeds Memory But Doesn't Use Virtual Memory

I have an application that allocates memory with 'new' and frees them with 'delete' in some parts of the code. The problem is that whenever it exceeds the memory limit of the system (let's say 2GB), Windows sends a Kill signal to the process. I think it is not usual since it should use the swap space(I think in windows it is called virtu...

What does kernel memory contain in Windows OS?

Hi. As is widely known, a program running under 32-bit Windows OS has only 2GB of virtual memory available. Also it is known that the other 2GB are reserved as Kernel space. But what is actually in that kernel space? I could understand reserve needed for kernel itself, but why kernel space in VAS of process? Thanks. ...

Is "Understanding the Linux Virtual Memory Manager" by Mel Gorman too outdated?

I am trying to get a deeper understanding of the virtual memory manager of linux. If have found a book called "Understanding the Linux Virtual Memory Manager[1]" written by Mel Gorman which looks quite elaborate. Unfortunately it is based on the 2.4 kernel series so its kind of ancient. Has anyone read the book? Is it still relevant? Al...

Why 16-bit address with 12-bit offset results in 4KB page size?

Hi guys, I'm reading the "Modern Operating System" book. And I'm confused about the "Page Size". In the book, the author says, The incoming 16-bit virtual address is split into a 4-bit page number and 12-bit offset. With 4 bits for the page number, we can have 16 pages, and with 12 bits for the offset, we can address all ...

Using the pagefile for caching?

I have to deal with a huge amount of data that usually doesn't fit into main memory. The way I access this data has high locality, so caching parts of it in memory looks like a good option. Is it feasible to just malloc() a huge array, and let the operating system figure out which bits to page out and which bits to keep? ...

Memory Management - How and when to write large objects to disk.

I am working on an application which has potential for a large memory load (>5gb) but has a requirement to run on 32bit and .NET 2 based desktops due to the customer deployment environment. My solution so far has been to use an app-wide data store for these large volume objects, when an object is assigned to the store, the store checks f...

Interaction of fork and user-space memory mapped in the kernel

Consider a Linux driver that uses get_user_pages (or get_page) to map pages from the calling process. The physical address of the pages are then passed to a hardware device. Both the process and the device may read and write to the pages until the parties decide to end the communication. In particular, the communication may continue usin...

How do you empty a cache when we you measure function's performance.

CPU cache always interrupts what we test a performance of some codes. gettime(); func1(); gettime(); gettime(); func2(); gettime(); // func2 is faster because of the cache.(or page faults of func1()) // But we often misunderstand. When you measure your code performance, how do you remove the cache's influence. I'm finding some funct...