[ale] Can someone help me understand memory usage?

Ben Coleman oloryn at benshome.net
Fri Apr 26 10:55:53 EDT 2002


On Fri, 26 Apr 2002 07:53:56 -0400, Geoffrey wrote:

>I don't know how 2.4 kernels have changed, but either I don't understand 
>what you've just said, or I think it's a poor direction to head.  The 
>LAST thing the OS should do is use swap.  It should look for unused 
>memory and take advantage of it.  Using swap is kinda like you've got a 
>bus load of folks and there's no more room, so you take the bicycle off 
>the roof rack and hand it to the next guy trying to get on the bus. 
>AND, the bus then stays behind the guy on the bike.  Point being, using 
>swap slows down everything.

Unless, of course, the swapped out code doesn't actually run that
often.  If a page is only actually touched by the CPU once a day, it
doesn't hurt to have it sitting in swap the rest of the time (whether
because it got swapped out in an actual RAM full condition, and just
hasn't needed to be swapped back in yet or because it got swapped out
by an aggressive VM implementation).  In fact, one might argue that
it's better off there, as that frees up a page of RAM to be used for
more active code.  Idle pages sitting in swap don't slow things down
appreciably, and might even overall speed things up.

Put another way, it sounds like the 2.4 kernel regards pages that have
sat untouched in RAM for a long period of time as 'unused memory', and
swaps out the contents so it can take advantage of the RAM.

Ben
-- 
Ben Coleman oloryn at benshome.net      | The attempt to legislatively
http://oloryn.home.mindspring.com/   | micromanage equality results, at
Amateur Radio NJ8J                   | best, in equal misery for all.



---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list