Forum Moderators: bakedjake
Mem: 1028296k av, 871072k used, 157224k free, 0k shrd, 83672k buff
663660k actv, 21160k in_d, 12016k in_c
Swap: 2048276k av, 17864k used, 2030412k free 383136k cached
I'm looking at the swapfile useage - I see 17 meg "used". Can I find out exactly which process is using it?
I'm not sure why it's being used with 157mb RAM free.
The last thing I want is MySQL having to swap. Is there any way of digging into this info?
There are no problems with the server, I just like to know what I'm looking at and how to interpret it. I've searched all over using "TOP" related searches, but I'm wondering if I'm looking in the wrong place.
Thanks,
TJ
Windows and Linux both will swap stuff out in order to free up more memory for disk cache. Windows 98 does it so much that it can hinder performance, so in 98 I always limit the maximum disk cache size.
Windows XP is pretty good at it. Right now mine says 40 megs of kernel memory paged (swapped), with 589 megs free.
Linux I trust to be the most intelligent, which means that with plenty of free memory, it should only be swapping out pages that haven't been used in a while, and it figures won't be needed much. I checked 3 linux machines, and they're all using a small amount of swap, with a quite large disk cache.
I think that rather than what processes are being swapped, it's more interesting to know what processes are using the most memory, because those are the ones that cause the swapping. Pressing M in top will sort by total memory usage.
The best way to see if you're swapping heavily is with vmstat. Run something like "vmstat 5", ignore the first line, and look at the si and so columns. Look also at the swpd column to see if it's changing much.
I'd be interested in seeing if there is a way to attribute swap usage to a particular process. It was my understanding that the kernel doesn't really care what process a page belongs to, it just wants to get stuff that hasn't been used recently out of memory.
Sean