Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "M. Nicklaus" <mn1@helix.nih.gov>
To: axp-list@redhat.com
Cc: "M. Nicklaus" <mn1@helix.nih.gov>
Subject: Re: where does the memory go?
Date: Tue, 9 Mar 1999 16:57:44 -0500	[thread overview]
Message-ID: <Pine.SGI.4.09.9L.9903091622230.11809-100000@helix.nih.gov> (raw)
In-Reply-To: <Pine.LNX.4.05.9903091109060.15757-100000@gumby.dynatec.com>

Matt,

On Tue, 9 Mar 1999, Matt Nelson wrote:

> On Tue, 9 Mar 1999, Daniel J. Frasnelli wrote:
> > And let's compare this to my system with 128M ram:
> > [dfrasnel@relativity /tmp]$ free
> >              total       used       free     shared    buffers     cached
> > Mem:        127312     115416      11896      73936      13832      61216
> > -/+ buffers/cache:      40368      86944
> > Swap:       131064        632     130432
> > 
> > If you look at both of these 'free' outputs, you will notice that a good 
> > amount of memory is tied up in both cached and shared memory allocation.
> > My system shows approx. 11M of physical memory free.  However, if I were to 
> > launch Netscape 4.51 (memory footprint of what, 30M?) I could do so
> > without dipping into swap space.  
> 
> what you say is true, but i was more concerned with the -/+ buffers/cache
> line of the free(1) output.  that line, if i understand it correctly,
> indicates what your are using and have available if you dont count buffers
> and cache.  in your example, it shows that you have about 40M used and
> about 87M free.  *those* are the numbers that i'm wondering about.  on my
> machine, the -/+ buffers/cache used climbs to ~110M during the activity of
> the day, then drops down to ~25M during the night.
> 
> when i compare the 110M to the output of "ps axm" during a quiet time in
> the day (i.e., no user jobs running), i see that the the total memory used
> doesn't seem to add up to the 110M that free(1) indicates.  and yes, X has
> the biggest memory footprint on an idle machine...
> 
> at first i thought there was a memory leak somewhere, but when it went
> back down to something reasonable over night, i figure that i must not be
> understanding something.
> 
> any other ideas? 
> 
> -matt

We've seen this kind of effect repeatedly on our various Alpha/Linux
boxes.  Often, as was pointed out, it has no real negative effects.
But we've definitely had cases where we couldn't start up certain
applications any more, or could not even telnet into the system any more.

Often, it seems that network-related processes contribute to this
behavior, especially if there's a problem with the network, or some faulty
network setup etc.  We've had cases where a 512 MB machine came up with 
4 kB free memory after RPC'ing like crazy during boot-up.

Without being experts in this, we've attributed this to some kind of
memory fragmentation caused by processes that may be long dead, and which
is possibly not cleaned up optimally.  The size of the swap space seems to
play an important role here:  with swap space smaller than physical
memory, it appears that the system has more difficulties moving large
applications (and buffers etc.?) in and out of memory without causing
memory fragmentation.  After setting swap space to at least physical RAM
size on all machines, this problem has become much less frequent.

Be that as it may, we've solved this problem by writing a little "RAM
scrubber" application that allocates, and actually accesses, progressively
larger chunks of memory, up to a user-defined limit (it doesn't pay much
to go all the way into swap space, obviously).  This little program has
solved the above problems for us in all cases.

An example I just ran on one of our Alphas:

"before"
             total       used       free     shared    buffers     cached
Mem:        515320     506744       8576      14880     383880      13424
-/+ buffers:           109440     405880
Swap:       590176        144     590032

"after"
             total       used       free     shared    buffers     cached
Mem:        515320      12264     503056       5216        208       3184
-/+ buffers:             8872     506448
Swap:       590176       1992     588184


If there's interest, I can post this program here.

(BTW, this effect doesn't seem to be unique to Alpha/Linux.  We've seen it
on x86/Linux as well as SGI IRIX, albeit to some lesser extent.  In any
event, we've installed our little "RAM scrubber", or "fragbuster",
program, on *all* our Linux/Unix systems.)

Hope this was of some use,

Marc



  reply	other threads:[~1999-03-09 22:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-09 16:14 where does the memory go? Matt Nelson
1999-03-09 17:29 ` Paul B. Brown
1999-03-09 18:43   ` Daniel J. Frasnelli
1999-03-09 19:16     ` Matt Nelson
1999-03-09 21:57       ` M. Nicklaus [this message]
1999-03-09 23:32         ` Matt Nelson
1999-03-10  9:30         ` Dr . David Alan Gilbert
1999-03-10 15:05         ` Greg Lindahl
  -- strict thread matches above, loose matches on Subject: below --
1999-03-10 21:40 M. Nicklaus
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox