Monday Nov 12, 2007
Monday Nov 12, 2007
I seem to be having some really odd (annoying?) problems with my Linux swap partition lately. The latest is that the partition fills up over time. Some application or process is not cleaning up after itself, and the swapped data is left laying around gathering dust in the swap partition.
My current hardware config is an AMD 64 X2 3800+ with 2Gb of RAM and a 4Gb swap partition. Under normal day-to-day use I rarely ever see the swap partition in use. Sometimes though I have a bunch of things running and it uses up more memory than what is physically available... and stuff gets moved to the swap partition (I do run a lot... an apache2 server, MythTV, my KDE desktop, KTorrent, Skype, Ekiga, etc etc, and at times VMWare and VirtualBox). Previously, when whatever application was needing swap space was closed, the swap would be released and I would see swap partition use drop. Exactly the same as I see with the RAM use.
The new behavior though... swap space remains allocated... and over a couple of weeks the partition fills to the point where there is no more free space. Once that happens, and I run more things than there is room for in physical RAM, things really really slow down. The only way I have found to fix things once it gets this far is to reboot. Issuing a swapoff command results in an error that indicates that there is not enough available memory (I don't have the exact text of the error).
I have done some rudimentary investigating... things like running top and looking at the memory allocation, but nothing stands out as obviously the problem. Also trying to see if it is one particular application.... looking for zombie processes that are hanging around and not allowing the swap allocation to be released.... nothing seems to be linked to the problem.
I will be installing a new Linux version in January... that might clear up the problem... or it might not, especially if I continue to use whatever application is leaking into the swap partition.
Like I said... odd and annoying problem... and as yet, one without a decent solution.