From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 24006 invoked from network); 9 Mar 1999 22:04:21 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 9 Mar 1999 22:04:21 -0000 Received: from helix.nih.gov (helix.nih.gov [128.231.2.3]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA05352 for ; Tue, 9 Mar 1999 16:57:50 -0500 Received: (from mn1@localhost) by helix.nih.gov (8.9.1a/8.9.1) id QAA22953; Tue, 9 Mar 1999 16:57:45 -0500 (EST) Date: Tue, 9 Mar 1999 16:57:44 -0500 From: "M. Nicklaus" To: axp-list@redhat.com cc: "M. Nicklaus" Subject: Re: where does the memory go? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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