[1835] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: Cleaning up memory space after something goes awry

daemon@ATHENA.MIT.EDU (Otto Hammersmith)
Wed Oct 30 12:17:58 1996

From: Otto Hammersmith <ohammers@cu-online.com>
To: redhat-list@redhat.com
Date: Wed, 30 Oct 1996 11:15:20 -0600 (CST)
In-Reply-To: <199610300348.TAA01118@va.ca.us> from "Ariel Mazzarelli" at Oct 29, 96 07:48:16 pm
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

Ariel Mazzarelli wrote:
> 
> Five minutes ago, I made an excessive request to ghostscript, and after making
> my hard drive hum for a couple of minutes, the box coughed
> 
> [mazzare@va tempy]$ Error: Cannot perform malloc
> 
> and ghostscript left the premises. No biggie, it's not like I have to reboot
> or anything, but I noticed that the swapping continued after that (though not
> really slowing things down much). Here is what the free command says,

Ran out of memory, probably.  You may want to increase your swap, if
you need to do this kind of thing.
 
[snipage]

> Does one want to see that "used swap" column reach 0, or do we
> simply not care?

I certainly don't care... but I have 100 megs of swap. ;)

Actually, it probably just means you have some programs running that
you never actually use... so they end up in swap, and never come out.
This is probably pretty typical of a generic Red Hat install which
turns on a whole slew of servers just in case you need them.

> I remember reading an ancient LJ article, possibly written by a distinguished
> member of this very list, that explained that it was actually the "free"
> column that should not be very high, as "free" was close to "wasted". OTOH,
> it sure seems like the system drags its feet when that "free swap" entry
> gets low. We like big buffers, I suppose.

Micheal (sp?) Johnson, I assume?

In any case, he was talking about physical ram, not swap.  Though, I
suppose the same idea could be applied to swap... if you never use the
last 20 megs of your swap, that's 20 wasted megs.

The basic idea with RAM, is that if it's unused you might as well use
it for a disk cache.  So, Linux grows and shrinks it's disk cache as
memory is needed or freed by other applications.
 
> When something goes awry, is there something less drastic than a reboot that
> one may do to get rid of residual effects (e.g. excessive swapping)?

Do something with the program in swap... it really doesn't matter, and
having those unused programs in swap frees up more space for disk cache.
 
> What are some of the clever things that Linux does to handle memory resources
> wisely--e.g., why does the same hardware that more or less flies under Linux
> behave like a constipated pig under other more famous o$'s? That "shared"
> column is part of the cleverness, as apps that use the same stuff get to
> share it in memory space (to the extent that that is a safe thing to do).
> What are some of the other clever things being done with RAM?

I'm not absolutely sure about this one, so don't quote me...

I believe the various MS (again, I'm not sure which or if any apply)
OSes use a different swapping scheme.  Linux uses demand paging, where
I believe Windows uses (dammit I can't rember the name)
swapping... the basic difference is that Linux can swap parts of a
program, where Windows* have to swap the entire application in and out
of memory.

Someone please correct me if I'm wrong... I've been meaning to find
out the answer to this one for a while.
-- 
					-Otto


--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post