- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Isolate top process consuming cpu and memory
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2012 10:04 AM - edited 01-24-2012 10:08 AM
01-24-2012 10:04 AM - edited 01-24-2012 10:08 AM
Isolate top process consuming cpu and memory
Hi All,
cpmtest> uname -a
HP-UX oradev1 B.11.23 U ia64 0074225043
I am trying to isolcate top process in terms of memory and cpu. I am using following command to get those details.
it seems to me, on HPUX, it may not be the command to achieve the desired result.
cpmtest> ps -e -o pcpu,pid,user,tty,args | sort -n -k 1 -r | head ps: illegal option -- o usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist] Usage: sort [-AbcdfiMmnru] [-T Directory] [-tCharacter] [-y kilobytes] [-o File] [-k Keydefinition].. [[+Position1][-Position2]].. [-z recsz] [File].. cpmtest> ps -e -o pmem,pid,user,tty,args | sort -n -k 1 -r | head ps: illegal option -- o usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist] Usage: sort [-AbcdfiMmnru] [-T Directory] [-tCharacter] [-y kilobytes] [-o File] [-k Keydefinition].. [[+Position1][-Position2]].. [-z recsz] [File]..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2012 11:10 AM
01-24-2012 11:10 AM
Re: Isolate top process consuming cpu and memory
The following should do what you want:
UNIX95=1 ps -eo pcpu,pid,user,tty,args | sort -rnk 1,1 | head
The key changes are:
1) Adding the UNIX95=1 to enable the XPG4 options to the 'ps' command.
2) Redoing the sort command. The order you had the arguments in didn't work. Having the '-r' last is not valid syntax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2012 11:13 AM
01-24-2012 11:13 AM
Re: Isolate top process consuming cpu and memory
You coming from Solaris? The ps command works slightly different on HP-UX, and you need to be careful with your sort syntax as well...
By default, HP-UX uses its own ps implementation, to get it to behave like the UNIX 95 standard you need to set the UNIX95 environment variable, but typically you don't want it set by default, so if you want to use any of the command arguments/options listed as "UNIX Standard Only" on the ps man page, you do something like this:
UNIX95= ps -eo pcpu ...
So your first command line becomes:
UNIX95= ps -e -o pmem,pid,user,tty,args | sort -nr -k 1 | head
(note I fixed your sort syntax as well)
For your second command line - there is no equivalent of pmem, so the closest you can probably get is vsz - so try:
UNIX95= ps -e -o vsz,pid,user,tty,args | sort -nr -k 1 | head
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2012 01:32 PM
01-24-2012 01:32 PM
Re: Isolate top process consuming cpu and memory
I've already corrected your command in your previous thread: