Operating System - HP-UX
1833770 Members
2449 Online
110063 Solutions
New Discussion

swapinfo reserve used total

 
SOLVED
Go to solution
Camaron McCluggage
Occasional Advisor

swapinfo reserve used total

I have some questions about swapinfo and memory reservations in HPUX 11.0.

I've read the man page for swapinfo and it does not specify in detail what is being counted in the reserve used total shown.

Can anyone fill me in on what the OS is adding up to arrive at the reserved total shown by swapinfo? What I am getting at is when I go into gpm I can see the RSS and VSS totals for the processes. Is the reserved total shown by swapinfo simply a summation of the RSS and VSS totals for every process currently running?

Also, if I drill down into the Process Memory Regions for a process, I can see the breakdown of the RSS and VSS totals for that process. Those totals include shared memory allocations.

How does the OS count those shared memory allocations when it comes to the swapinfo reservation? Does a shared memory allocation get counted only once because it's shared memory that several processes might be using? Or does each process's shared memory total get added into the overall reservation separately so the OS has each allocation accounted for in case it has to swap the whole process?

I can see how either approach would make sense, but I have not found an answer anywhere.

With gratitude,

Camaron
3 REPLIES 3
Brian Bergstrand
Honored Contributor

Re: swapinfo reserve used total

The swapinfo reserved total should be a total of all process VSS sizes. RSS is not included seperately in the reserved count, because it is a subset of the VSS size.

As for shared memory, that makes things a little bit harder. Shared memory segments are mapped into a separate part of the address space, and I think they are counted as part of the VSS size that you see, but not the RSS size.

HTH.
Camaron McCluggage
Occasional Advisor

Re: swapinfo reserve used total

Sorry for somehow getting this into the wrong category. I could swear I was in the system admin forum when I clicked the new message button.

C-
James Murtagh
Honored Contributor
Solution

Re: swapinfo reserve used total

Hi Camaron,

The reserve field is incremented when a process "reserves" a certain amount of memory in case it later needs to page any part of it out. This may seem a simplistic statement but that is the theory behind it. For instance, if you malloc() an amount of memory the space is not used immediately - it is reserved by the process for future use.

Where you can reference from here is the pstat() interface, which is what swapinfo and Glance use to find the information you are seeing. You will note there are per-process calls and global calls. For each process gpm will show the shared memory addresses irrespective of other processes, it can't really do anything else. For swapinfo's global count it doesn't add up every attach to a segment, that would create a false picture.

Take a look at a previous thread I updated, using a more cli method to illustrate :

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xb4da506d69a7d711abdc0090277a778c,00.html

If you have any more questions, please ask.

Cheers,

James.