Odd swap usage even though there is free RAM
Ive had this weird thing going on for a few months now. The machine has 2*512M RAM (tho only 883 detected, highmem off). Ive also got a gigantic swap partition together amounting to 1788 megabytes.
The chain of events goes like this: When the machine is reebooted, all is fine for a few days. Then, swap usage starts to go up and up and up. atm after 35 days of uptime, swap usage is at 50%, so is RAM. Heres a quote of free -m: Code:
total used free shared buffers cached Now, what ive understood of memory management is that the kernel cahces files to the RAM for faster reads, but it shouldnt do this to the swap, right? So, if my memory has cached RAM to spare, what is being swapped constantly? Is there some fancy way to track what is using the swap space, a top parameter for instance? This isnt a problem that would cause me any trouble, but im quite intriqued as to what is going on. _I've always thought swap would go unused as long as there was RAM available, right? *confused* Sysinfo: Slackware 10.2 Linux 2.4.31 (bare.i clone with minor additions) |
do you do anything graphics intensive??
I notice when using the Gimp.....that swap gets used, not a whole tho, just enough that I notice it............. |
I use Gimp every few days or so, but I always close it after im done.
One thats gotten me pondering tho is Captive NTFS. I installed it at about the same timeframe that these problems started. Tho, ive got no idea why it would swap so much data, except if it insists on swapping the NTFS partition the same way the kernel likes to swap files. Well, it hasnt even been on actually for a month now, so I doubt that its the responsible one, except if it forgot to clean its swap usage somehow.. d: |
Okey, this is getting scary:
Code:
Swap: 1788 1408 379 |
okies, figured out how top can monitor swap usage, here are the processes that are over 100 megs:
Code:
PID USER VIRT S %MEM SWAP COMMAND edit: I restarted X and all the X apps with it and now swap usage is down to 73 megs, and ram down to a few hundred.. So, all is well for now, but is it normal to have to restart X every month or so, just to cope with memory? Surely there cant be a memory leak in all of X, firefox, gDeskcal(the python process) and xmms? |
Hi
Yes what happens is that once your free memory is used up by an application, not all of it is returned back to the OS - so eventually it will go to your cache and start using that. That is what is happening. some of the code of certain applications are kept in memory even when you close them, so when you open it later it is alot quicker. Eventually all your memory is gone. |
All times are GMT -5. The time now is 11:58 PM. |