Swap - forcing Swap

James Gray james at grayonline.id.au
Thu Sep 29 21:21:54 UTC 2005


On Fri, 30 Sep 2005 06:53, René L. Reingard wrote:
> hello,
> today i see first time that the 'Systemmonitor' in a panel can be
> expanded into different branches, like Processor, RAM, Network, ...
> Ubuntu is allways new!
> now i also see that the RAM (Pentium 3 with 256MB RAM) is allready with
> the simple desktop used to a high percentage (like 80%) and if greater
> processes are going on, RAM usage goes up that 100% (Cache then around 40
> to 60%).
> BUT the Swap Partition is not used at all (in the beginning) and goes to
> a use of 25% after 15 minutes of heavy work (like Scanning the harddisk).
>
> how the usage of the Swap can be forced - as the RAM is anyway allways
> used by around 80%.

Hi René,

This question is asked often by noobs - no offense :)  The important thing 
to note is the Linux is not Windows (or any other operating system for that 
matter) and its memory management is different too.

While Linux is running it puts frequently used files and libraries into 
"cache" memory.  From here they can be quickly retrieved - *much* faster 
than going back to the disk.  Similarly Linux will buffer disk reads and 
writes until certain thresholds are met, then commit them to disk when 
there is less activity.  This, again, dramatically improves overall 
performance.

So, you've got all this RAM in your system, and Linux is trying use it as 
efficiently as possible to give you the optimum performance, but you'd 
prefer to have it flogging away at the hard drive? ;)  Didn't think so.

The thing to remember is that as applications require more RAM, Linux will 
either sacrifice buffers and/or cache, which may mean paging stuff out to 
the swap space.  It could also mean simply flushing some buffer space.  It 
all depends on what is in RAM, what you're doing with your system the the 
mix of RAM and swap space you have.

Memory management isn't something most users should really be too concerned 
about.  If you're running out of swap and the system runs like a dog, 
*then* you may need to add more RAM  Beyond that, don't sweat it; a default 
Linux kernel is doing a better job than you will of managing your RAM + 
swap :)

Cheers,

James
-- 
A wise man can see more from the bottom of a well than a fool can from a
mountain top.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050930/e69823ba/attachment.sig>


More information about the ubuntu-users mailing list