Strange memory issue(?) with 6850

Kuba Ober kuba at mareimbrium.org
Fri Mar 2 16:03:46 CST 2007


On Friday 02 March 2007, Dominique.GARNIER at arval.fr wrote:
> Hello,
>
> I'm completely clueless about what's happening there. When i type a free
> in some of our 6850
> (Redhat Enterprise 4 AS U4 smp kernel x86_64 fully patched) i have
> something looking like
> the following:
>
> free
>              total       used       free     shared    buffers
> cached
> Mem:       8158444    3251208    4907236          0     276884
> 835120
> -/+ buffers/cache:    2139204    6019240
> Swap:      6265340          0    6265340
>
> So it seems that i have like 2Go of memory used BUT this is not the
> case. Nothing is running
> on the server right now apart from dell omsa. At the same time, we're
> experiencing the
> aknowledged memory leak issue with OMSA (5.1.0) but i restarted it just
> before doing this 'free'
> and it released like 900Mo of memory. But i'm still left with another
> 2Go of memory used.

Here's what I make of it:

Modern OSes generally don't like wasting your precious memory. Free RAM is RAM 
for which you've paid and you get nothing in return. On very lightly loaded 
system, a modern OS will typically cache most of the disk blocks that were 
ever accessed since the boot. So your expensive 2.5ns RAM is working to make 
disk accesses quicker, at least! As soon as you start loading more 
applications and there's more memory pressure, the cache allocation will drop 
significantly.

The free tool does not tell you what you think it does. Used memory isn't 
necessarily used by the applications, and isn't necessarily "taken" by the 
kernel. In your case most of the "used" memory is highly liquid and can be 
allocated for appliations almost instantly.

If you want to try it out, write a small C program to malloc() a gigabyte of 
RAM, and then mlockall(). Subsequently go over the malloc()ed memory it in a 
loop and write to every page (to make sure the pages are committed). Or 
disable overcommit in the kernel.

On your system, you should be able to fire up about 6 such processes, at which 
point the "used" memory will grow to 100%. Yet you still have 6GB for 
*exclusive* use of those applications (kernel won't swap those pages!). 
That's in spite of supposedly 3/8 of your memory being previously used.

Cheers, Kuba



More information about the Linux-PowerEdge mailing list