Memory allocation in Linux
<p>I got a doubt with memory allocation in Linux</p>
<p>I am having 256 MB of RAM in my portable player and the linux kernel is given with parameter "MEM=110M" while booting, </p>
<p>Can any one explain what does that mean</p>
<p>Is it a ...</p>
<p>1) 110 M is given for Kernel memory and remaining 146 is for user-space memory</p>
<p>or
2) 110M is given for kernel & user-space and remaining can be configured as per requirement (may be... say, driver memory)</p>
<p>Also, when i start a application that has many malloc in it., at some point the malloc() function returns null., whereas i parallely checking through Telnet for the "free memory space" through "free" cmd, it returns 39 MB as unused (ie., free)</p>
<p>I am little confused now (may be i am not knowing the memory partitions), can any one explain on this </p>
<h2>Thanks in advance</h2>
<p>Thanks Jlliagre,
My free observation is here</p>
<pre><code>> #free
> total used free shared buffers
Mem: 106428 66560 39868 0 5240
> #
</code></pre>
<p>" Jlliagre --- Malloc is allocating virtual memory while free is displaying RAM and SWAP usage " </p>
<p>fine, then does it mean that virtual memory for a process is fixed amount so that other processes will also get memory, instead of putting other processes running out of memory.</p>
<p>my concern is even-though free shows 39868 KB, it fails on malloc() of 2.5 MB</p>