System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Filter process using more swap

SOLVED
Go to solution
Vee_1
Frequent Advisor

Filter process using more swap

Hello Everyone, i need to filter the process which is using more memory (swap) in hpux box.In top and glance we can able to see the process but can't filter it .Your suggestions please...
6 REPLIES
kobylka
Valued Contributor

Re: Filter process using more swap

Hello Vee!

There is an option for top to write a "snapshot" to file which you can subsequently use for filtering out this process:


top -f top.log


Kind regards,

Kobylka
Vee_1
Frequent Advisor

Re: Filter process using more swap

We can do that but we only get the first page of top and not the remaining pages.
Michael Steele_2
Honored Contributor
Solution

Re: Filter process using more swap

Hi

Refer to the ps -o options especially vsz for virtual stack size and pipe it into a UNIX95 command after you've selected the arguements from -o that you want.

UNIX95=1 ps -ef -o vsz,pcpu,ppid,pid,comm | sort -rn | top -10

Eact arguement represent a column of data but only the 1st argument is sorted in reverse order.
Support Fatherhood - Stop Family Law
kobylka
Valued Contributor

Re: Filter process using more swap

Hello Vee!


Use a large enough number with -n flag to get all your needed processes written to file:


top -f top.log -n

Kind regards,

Kobylka
Steven E. Protter
Exalted Contributor

Re: Filter process using more swap

Shalom,

UNIX95=1 ps -ef -o vsz,pcpu,ppid,pid,comm | sort -rn | top -10

The important part here is vsz, which stands for virtual size.

That based on this command syntax, which is not mine (I cut and pasted it) will give you the biggest reserver of swap first.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vee_1
Frequent Advisor

Re: Filter process using more swap

Thanks for everyone's input.