Applications in Swap
I'm currently trying to locate which processes are in the swap space and how much memory that processes is using. Could someone help me tell the correct program to locate this...
|
applications per say aren't in or out of swap space the way it might be in some very old legacy operating systems. swap is used only to store non media backed anonymouse data and the data that is swapped out is in relation to it not being accessed in a while. virtual page mapping as far as i know is non contiguous but you might be able to figure out what is in swap by looking in the /proc filesystem
if you understand memory addresses ? I know i can't figure it out. |
You won't be able to tell from the memory address. When a page is swapped out all the will happen is that that page will be marked as invalid in the process' page table (and there's some other accounting records to show how to find it in swap). One thing to do is run top, and then press the "f" key to choose what fields are shown. Modern versions of top will have the ability to display the amount of the process that's currently swapped (pressing P in the field selection in my version of top).
|
Thanks for the information
|
Quote:
i think this means it is actually spelled out in /proc somewhere -- all top does is parse /proc possibly /proc/<PID>/statm or something would have to make machine use swap to check it out -- a task for another day |
OK i tried this and the SWAP output from top is crap
it's just SWAP = VIRT - RES that tells us exactly nothing back to squARE 1 if we can identify dirty anonymous pages and determine if they have ever been ejected then there we have swap yes |
Quote:
That would be precisely my definition. Could probably be (more logically) expressed as "VIRT = RES + SWAP". What have dirty pages got to do with the swap discussion - if they are dirty they are "pinned" in physical memory, and so are included in the resident count. If they are anonymous, and have been swapped out, they are in the SWAP count - and increase the VIRT size accordingly. I haven't looked specifically at the code for this, but seems logical to me. |
Quote:
Code:
(12:31pm:11/05/05) so lets look at what you said for startx Code:
with 0 swap actually used and lots of physical RAM free it seems rather obvious that all the virtual memory is not in either swap or resident but is "virtual" duhhhh. and clean anonymous pages under memory pressure just get ejected not written to swap because they contain nothing at all so dirty has something to do with it. |
O.K. I'll shut up and go back and hide under my rock ...
I've always been happy to accept VIRT = RSS + SWAP. Maybe that's just a convenient shorthand for "VIRT = RSS + all the other bits" ... :p Those numbers do need some explaining that is beyond me. May just be an issue with the way "top" calculates and/or presents the numbers, although meandering through /proc/<pid>/status also shows some (lesser) annomalies. Dunno ... |
All times are GMT -5. The time now is 09:34 PM. |