- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- List top 10 user process sort by memory usage
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
Forums
Discussions
Discussions
Forums
Discussions
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
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
11-09-2004 06:58 PM
11-09-2004 06:58 PM
List top 10 user process sort by memory usage
Or when I use 'UNIX95= ps -e -o ruser,vsz,sz,pid,ppid,args |sort -rnk3' the total sz calculate value is not equal to my physical memory size, very annony question for me,
How should I do to convert the sz column value into MegaBytes or KBytes, as I heard from RC, the sz is 4k pages, Can anyone give me the convert formula ? thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 07:10 PM
11-09-2004 07:10 PM
Re: List top 10 user process sort by memory usage
Well.. Simply adding the 'memory' used by all processes is not going to fill up your balance sheet. You will need to add buffer cache, dynamic memory buckets used by kernel, shared memory segments etc., in your calculations.
If you have glance, use it to get the picture. sz is in pages which is 4096 bytes by default. TO get the next level, devide it by 1024. For ex., 4096(b)/1024 = 4k similarly 4096(k)/1024=4MB.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 07:34 PM
11-09-2004 07:34 PM
Re: List top 10 user process sort by memory usage
ruser vsz sz pid
operapp1 137352 34338 10550
operapp2 144004 32856 5694
operapp3 125064 31266 9423
operapp4 125064 31266 8582
operapp5 86120 21434 17170
operapp6 83080 20770 10812
------ cut -----------------------
for example pid 10550, sz is 34338
use the fomula
(34338*4096)/(1204*1024) equal to 134MBytes,
Is this right ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 07:55 PM
11-09-2004 07:55 PM
Re: List top 10 user process sort by memory usage
As said, the sum you will get will not tell you how many memory is really used on your system. There are many other usage of memory (for example, you use Oracle, so "IPCS -mb" will show you shared memory segments).
Due to rounding and other misterious things, values given by top, ps or glance may vary. So don't expect an exact calculation ("but where is my missing KB ?" :) ).
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 08:35 PM
11-09-2004 08:35 PM
Re: List top 10 user process sort by memory usage
These things are all relative
For a guide
#RSZ = Resident set size
#VSZ = Virtual set size
#
#RSZ is a subset of VSZ
#-the portion of the processes memory which is 'resident'
#in physical memory (ie not paged out).
#
#VSZ is the total size, including resident and non-resident pages.
#
#These values are totals, obtained by adding up the memory utilisation of the
#processes various memory segments (of which there can be lots).
#################################################################################
uname -a
echo -------------------------------------
/bin/rm /tmp/$PPID 2>/dev/null
if [ "$LOGNAME" = "root" ]
then
echo memory from kernel
name=$(file /stand/vmunix|grep 64)
if [ "$name" = "" ]
then
echo phys_mem_pages/D | adb /stand/vmunix /dev/kmem 2>/dev/null
else
echo phys_mem_pages/D | adb64 /stand/vmunix /dev/kmem 2>&1|grep -i page
fi
fi
echo " "
echo swap
echo -----------------
swapinfo -tm
echo " "
echo memory usage per process
echo "----------------------------------------------"
UNIX95= ps -e -o ruser,vsz,sz,pid,args > /tmp/$PPID
head -n 1 /tmp/$PPID
tail -n +2 /tmp/$PPID|
sort -rnk2
/bin/rm /tmp/$PPID 2>/dev/null
For real info
This excellent external hp ftp site will give you a goldmine on tools and info
Memory Usage - â What is using all of the memory?â
by:eric.herberholz@hp.com
Last modified: October 18, 2004
Full document is available at external ftp site: ftp://eh:spear9@hprc.external.hp.com/memory.htm
The "Table of Contents" is available in ITRC doc id MEMORYKBAN00000975
Steve S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2004 12:43 AM
11-10-2004 12:43 AM
Re: List top 10 user process sort by memory usage
# cat memtop
#!/bin/sh
# memtop - show top memory users and pid
# VSZ is in KB
echo "VSZ(KB) PID RUSER COMMAND"
UNIX95= ps -e -o 'vsz pid ruser args' |sort -nr|head -30
Rgds...Geoff