Operating System - HP-UX
1752751 Members
5181 Online
108789 Solutions
New Discussion юеВ

Determining what processes are taking up the most swap file space

 
Andrew Kaplan
Super Advisor

Determining what processes are taking up the most swap file space

Hi there --

Is there a command that can determine what processes are taking up the most swap file space?
The operating system in question is HP-UX 11.00.

Thanks.
A Journey In The Quest Of Knowledge
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: Determining what processes are taking up the most swap file space

Not that I can think of off the top of my head. I would probably look at Glance and focus on the Res Mem and Virtual Memory metrics. You can sort on those fields to tell you what is taking up the most memory.


Pete

Pete
Andrew Kaplan
Super Advisor

Re: Determining what processes are taking up the most swap file space

Hi there --

I have heard of Glance, and it is installed on our system, but I have never used it. Has anyone used it, and can provide insight into how it can help determine what, if any processes, are taking up the most swap space?
A Journey In The Quest Of Knowledge
Johnson Punniyalingam
Honored Contributor

Re: Determining what processes are taking up the most swap file space

just type

#glance

you can check swap space utilization

click m

hope this helps

Regards,
Johnson
Problems are common to all, but attitude makes the difference
Dennis Handly
Acclaimed Contributor

Re: Determining what processes are taking up the most swap file space

>Determining what processes are taking up the most swap file space

I assume you are just taking about swap in general? Otherwise you can't tell which are pseudo-swap vs device swap.
The following will sum swap and text for the VSZ KB column:
UNIX95=EXTENDED_PS ps -e -o pid,vsz,comm

(Not sure if it includes shared memory?)
Tingli
Esteemed Contributor

Re: Determining what processes are taking up the most swap file space

I think the command UNIX95=EXTENDED_PS ps -e -o pid,vsz,comm is more likely for checking the memory, not the swap space.
James R. Ferguson
Acclaimed Contributor

Re: Determining what processes are taking up the most swap file space

Hi:

> Tingli: I think the command UNIX95=EXTENDED_PS ps -e -o pid,vsz,comm is more likely for checking the memory, not the swap space.

If you consider that every process must reserve swap space in order to run, then the virtual segment size reported by 'ps' is probably as good an estimate of potential swap space utilization as you can get.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Determining what processes are taking up the most swap file space

> Tingli: I think the command ps vsz is more likely for checking the memory

You might be correct. I didn't see "virtual" on ps(1) but why have a name with "v" if it doesn't mean virtual? :-)
If you look at top(1), it says SIZE is virtual.

Or you can roll your own by calling pstat_getprocvm(2) by modifying my source in this thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1392232
(Assuming it would work on 11.00?)
Don Morris_1
Honored Contributor

Re: Determining what processes are taking up the most swap file space

If you're going to roll your own with pstat, then you don't need to guess with virtual sizes (where you really should differentiate Shared vs. Private MMAP, if it is file or memory backed, etc....).

Just add up the pvs.pst_swap fields from pstat_getprocvm() instead of the pst_length fields.

Sample code attached -- not compiled on anything older than v2, so it may need a little work to fit 11.0.