- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- process size
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
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
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
08-18-2005 03:24 AM
08-18-2005 03:24 AM
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 03:28 AM
08-18-2005 03:28 AM
Re: process size
The UNIX95= before is important, so it uses the XPG4 syntax of the command. Of course you can add more fields, I just added vsz (virtual set size), process ID and command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 03:29 AM
08-18-2005 03:29 AM
Re: process size
ps -o sz | grep
"man ps" for more options. There are lot of stuff you can see with ps when XPG64 support is enabled (UNIX95=1)
Alex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 03:39 AM
08-18-2005 03:39 AM
Re: process size
UNIX95= ps -e -o pid,vsz,args
as exporting UNIX95 variable may have some unexpected effects on processing of other commands in the same interactive session. Let it do its job for one command and die.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 06:10 AM
08-18-2005 06:10 AM
Re: process size
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 06:13 AM
08-18-2005 06:13 AM
Re: process size
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 06:14 AM
08-18-2005 06:14 AM
Re: process size
XPG4 is a standard. Use of UNIX95 enforces the ps command conformance to XPG4.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 06:16 AM
08-18-2005 06:16 AM
Re: process size
SZ
The size in physical pages of the core image of
the process, including text, data, and stack
space. Physical page size is defined by
_SC_PAGE_SIZE in the header file
sysconf(2) and unistd(5)).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 07:21 AM
08-18-2005 07:21 AM
SolutionHope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 07:31 AM
08-18-2005 07:31 AM
Re: process size
# cat processmem
#!/bin/sh
# processmem - display memory claimed by a process
# gwild 03192004
#
if [ $# -lt 1 -o \( $# -gt 1 -a $# -lt 4 \) ]
then
echo "Usage:"
echo "processmem \"process\""
echo "Example:"
echo "processmem rpc"
exit 1
fi
echo " "
PROCESS=$1
mps=0
#for sz in `ps -elf | grep $PROCESS | grep -v grep | awk '{print $10}'`
for sz in `UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1 | grep -v Kbytes | grep $PROCESS | awk '{print $1}'`
do
mps=`expr $mps + $sz`
done
#echo `expr $mps \* 4096`
echo "\nMemory claimed by $PROCESS: $mps Kbytes.\n"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 07:40 AM
08-18-2005 07:40 AM
Re: process size
But many processes, especially databases, use shared memory for rapid interprocess communication. Because it is shared, there is no accounting for this area in ps. You have to use ipcs -bmop to see the shared memory areas. And then there's the buffer cache which is shared by all processes that open files and read/write to them. And some processes may use memory mapped files...
Usually, you really don't need to know much more about RAM used by processes than supplied by ps, but it isn't a complete picture. To really see RAM usage, you need to purchase the Glance product.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 04:27 PM
08-18-2005 04:27 PM
Re: process size
Also, can i find the memory leakage by observing increase in memory size in glance tool ?
best regards,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 06:37 PM
08-18-2005 06:37 PM
Re: process size
ipcs
To view memory segments: ipcs -m
To view semaphores: ipcs -s
You also will see he PID of the process. There are many other options to view what processes attached to these segments and when they did it. For more options you can use "man ipcs"
Alex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 06:45 PM
08-18-2005 06:45 PM
Re: process size
The command "ipcs" displays information for the message queues, shared memory segments, and semaphores that are currently active in the system.
If you user # ipcs -a option shows in details about process thier ownership, size etc.
Regards,
RAjesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 11:33 PM
08-18-2005 11:33 PM
Re: process size
There is no magic monitoring feature that says: Memory leak in process 1234. To see this, start be ignoring processes that do not use a lot of memort and sort the processes by size:
UNIX95= ps -e -o vsz,pid,ppid,ruser,args | sort -rn | head -20 >> /tmp/topramusers.log
Now run this command regularly and then check the file every day (or hour) to see what is changing. Most questions like this are related to error messages about program too bin or unable to allocate more memory. And very seldom is this a problem with a memory leak--it is a problem with 32bit programs and their memory addressing limitations.
Bill Hassell, sysadmin