Lo, on , December 12, Brian Stults did write: > Is there a way to purge the swap disk? When I run something like > win4lin, it can sometimes take up a lot of disk swap. When I close the > program, the swap space still appears to be occupied. It's mostly an > annoyance, and probably doesn't affect anything. However, it seems that > perhaps it would be better to remove it from disk swap since the next > time the program runs there may be room for the information in the > faster RAM memory. Does that make any sense?
I suspect that the data on your swap device doesn't actually belong to the now-defunct win4lin process, but rather other processes that were swapped out to make room for win4lin. They'll be paged back into main RAM on next reference, as usual. (I don't actually know of any way to verify this---I don't know of a program that will tell you which process is using which pages on your swap device; this information is likely not stored in the kernel in a very convenient fashion anyway.) While it may look at first glance as though one would want the OS to bring these pages back into RAM as soon as there was room for them, this turns out to be a less-than-wonderful solution in the general case. Consider the case where win4lin terminates, and then you start up a new, large program (say, StarOffice). If the kernel automatically paged stuff back in when win4lin terminated, it would have to page it right back out again in order to make room for StarOffice. Much better just to let the kernel bring the pages back in again on demand. Richard