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

Memory by user - old hp-ux 10.20

 
SOLVED
Go to solution

Memory by user - old hp-ux 10.20

Dear friends,

 

I want to know amount of memory used by some process. I try "ps -eo vsz,ruser,pid,args | grep oracle" but "-o" option doesn't work in old 10.20 version. Any tips?

 

Thanks

Wagner
6 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Memory by user - old HP-UX 10.20

Have you used something similar to this syntax?

UNIX95=EXTENDED_PS ps -eo vsz,ruser,pid,args | grep oracle

Re: Memory by user - old HP-UX 10.20

Dennis,

 

Same problem:

 

ps -eo vsz,ruser,pid,args | grep oracle


ps: illegal option -- o
usage: ps [-edaflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup]


Wagner

Re: Memory by user - old HP-UX 10.20

I need data of RSS (glance screen) column in a format like "ps" command output:

 

Wagner

Re: Memory by user - old HP-UX 10.20


Dennis Handly wrote:

Have you used something similar to this syntax?

UNIX95=EXTENDED_PS ps -eo vsz,ruser,pid,args | grep oracle


Dennis,

 

Just now i figure out that i NEED to use "UNIX95=" as part of command. My results are something like this:

 

 PID       SZ      %CPU       RUSER    COMMAND
19093  2542    0            oracle   oracleceeec (LOCAL=NO)
22224  2472    0            oracle   ora_dbw4_ceeec
2010     0         0            root     /etc/opt/resmon/lbin/emsagent
24165  2549    0            oracle   oracleceeec (LOCAL=NO)

 

Second column is my target. I create a file named "test" and open it in VI to remove first line. So, i run:

 

cat test | awk '{ sum+=$2} END {print sum}'

 

7563 (total of second colunm)

 

Question: I need to multiply result by 4 to get size in kbytes?

 

Thanks

Wagner
Dennis Handly
Acclaimed Contributor
Solution

Re: Memory by user - old HP-UX 10.20

>Just now I figure out that I NEED to use "UNIX95=" as part of command.

 

Didn't I say that?  :-)

 

>open it in VI to remove first line.

 

No need.  You can use the "-oX=" form to remove the titles:

UNIX95=EXTENDED_PS ps -eo vsz= -oruser= -opid= -oargs=

 

Or get awk to remove it:

awk 'BEGIN { getline } { sum+=$2} END {print sum}' test

 

>I need to multiply result by 4 to get size in kbytes?

 

Yes.  If you were worried about later OS releases with larger page sizes:

page_size=$(getconf _SC_PAGE_SIZE)

awk -v pg_s=$page_size 'BEGIN { getline } { sum+=$2} END {print sum * (pg_s/1024), "KB"}' test

Re: Memory by user - old HP-UX 10.20

Thanks!!!

Wagner