Operating System - HP-UX
1753613 Members
6063 Online
108797 Solutions
New Discussion юеВ

Re: Memory Usage by User.

 

Re: Memory Usage by User.

UNIX95= ps -e -o vsz=Kbytes -o pid,args=Command-Line | sort -rnk1
Barakati
Frequent Advisor

Re: Memory Usage by User.

Hi,

I read one website stating..
For Example,

# UNIX95= ps -eo vsz,ruser,pid,args | sort -rn | more
26332 ids 1685 ./idsagent -a
5296 root 2178 /usr/sbin/stm/uut/bin/tools/monitor/fpl_em
4760 root 2713 /opt/perf/bin/rep_server -t SCOPE /var/opt/perf/datafiles/loggl
4068 root 1487 /opt/perf/bin/scopeux
4052 root 1243 /opt/dce/sbin/rpcd
3364 root 2715 /opt/perf/bin/alarmgen -svr 2714 -t alarmgen /var/opt/perf/data
3180 root 1465 /opt/perf/bin/midaemon
3148 root 1495 /usr/sbin/swagentd -r

And then look at the 1st column in the output to see the amount of memory used by this process for data/text and stack. This value is in pages, so multiply by 4096 to determine the size in bytes. Anytime you see that the size (SZ) is a four-digit number, that's relatively large, so it's one to watch over time and to see if it continues to grow, and therefore may have a memory leak.


Then i tried this.


#UNIX95= ps -eo vsz,ruser,pid,args | sort -rn | awk '{ val +=$1} END {print (val*4096)/(1024*1024*1024)}'
144.494

Do you think this value is in GB.
Is that means currently my machine using 144.494 GB? i do not think. I am trying to get the complete usage on my memory by all users. then by each users.
Is that possible using above command.

Please clarify.
Barakati
Frequent Advisor

Re: Memory Usage by User.

Thanks all i get it.

i did not concentrated on "vsz".
UNIX95= ps -eo ruser,pid,args,vsz=Kbytes |grep applmgr | awk '{ val +=$4} END {print (val)/(1024*1024)}'

will give me memory used by user "applmgr" in GB.

But if it is actual. How can i get actual using commands like this?

Thanks
Barakati
Frequent Advisor

Re: Memory Usage by User.

Hi Experts,

Do you think this command gives exact or very close to actual memory used by the user.

Because when i check the same on glance it is totally different.

with this command i sam 42.067 mb used by one user.

and it more than 500 mb on glance by the same user.

Any hints where i am going wrong.
Sandeep Verma
Occasional Advisor

Re: Memory Usage by User.

Hi,

you can use the HP tool kmeminfo to get the memory usage by user process and Kernel.

for CPU usage, please check
# top -d5 s10
# sar -Mu 2 10