I'm trying to understand in depth the virtual memory management on OS Linux.
I don't really understand how the OS determine the size of the VM for a process.
I know that an 32-bits x86 OS can give up to 3 GB of vm adress space... Is it always true ?
In my case, i have about 110 MB physical memory with and 32-bits Linux, and my main process have a vm adress space about 660 MB. However, only 50 MB are in physical memory (the RSS of my process), so my physical RAM isn't full. The rest is free and almost the whole is used by page cache. That's seems to be a normal behaviour.
If i check /proc/my_process_PID/smap, there are several 8 MB anonymous VMA.
My actual problem is that i need to make a additionnal 10 MB malloc in the code, but unfortunately OOM-Killer kills my process (out-of-memory) ... I think there are no more free available pages in the vm for the Heap, isn't it ? Is there an huge memory leak somewhere ?
Why the OS doesn't extend my process vm size so ?
For information the vm size is unlimited : ulimit -v : unlimited