- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How much memory a process use ?
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
- 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-22-2002 05:58 AM
08-22-2002 05:58 AM
It??s possible ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 06:01 AM
08-22-2002 06:01 AM
Re: How much memory a process use ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 06:03 AM
08-22-2002 06:03 AM
Re: How much memory a process use ?
# glance
# gpm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 06:20 AM
08-22-2002 06:20 AM
Re: How much memory a process use ?
Use the unix95 options of ps
#!/usr/bin/ksh
#
# Show processes sorted by size of core image
#
# Usage:
# psram [ quantity ]
#
# where quantity is the top RAM processes to show (default is 20)
#
set -u
if [ $# -gt 0 ]
then
TOPPROCS=$1
else
TOPPROCS=20
fi
MYNAME=$(basename $0)
TEMPFILE=/var/tmp/$MYNAME.$$
trap `rm -f $TEMPFILE > /dev/null 2>&1` 0 1 2 3 15
UNIX95= ps -e -o ruser,vsz,pid,args > $TEMPFILE
head -1 $TEMPFILE
DASH5="-----"
DASH25="$DASH5$DASH5$DASH5$DASH5$DASH5"
echo "$DASH5---- $DASH5- $DASH5 $DASH25$DASH25"
grep -v "VSZ COMMAND" $TEMPFILE | cut -c -78 | sort -rn -k2 | head -${TOPPROCS}
rm $TEMPFILE > /dev/null 2>&1
#### END OF SCRIPT
Or 2 lines to show top 20 by cpu with sz and vsz
1 echo " $(UNIX95= ps -e -o pcpu -o ruser -o sz -o vsz -opid -o args|head
-n1)"
2 UNIX95= ps -e -o pcpu -o ruser -o sz -o vsz -opid -o args|grep -v %CPU|
sort -nr|tail -n +2|head -n 20
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 06:25 AM
08-22-2002 06:25 AM
Re: How much memory a process use ?
UNIX95= ps -ef -o pid,vsz,args | grep
This will give you
the process ID (pid)
the number of KB of memory used (vsz)
the command with arguments (args)
This lists total memory, I don't know if there is a way to display shard memory use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 06:31 AM
08-22-2002 06:31 AM
Re: How much memory a process use ?
Select Reports->Process List->Process Memory Regions.
If you don't have Glance, you can install a 30-day trial version from your Application CD set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2002 08:36 AM
08-23-2002 08:36 AM
Re: How much memory a process use ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2002 05:58 AM
08-26-2002 05:58 AM
Re: How much memory a process use ?
I used a Steve Steel Script, and it returns me this value of a process PID 6381:
VSZ = 21528
The "ps -el" command returns:
SZ = 3606
The Myke Stroyan program, returns:
pid shared_vm shared_ram private_vm private_ram
6381 37456K 13788K 457272K 37852K
Who can explain this results ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2002 07:12 PM
08-29-2002 07:12 PM
SolutionThis is the virtual memory total for TEXT+DATA+STACK, measured as number of 4K pages.
> SZ = 3606
This is the virtual memory total for TEXT+DATA+STACK, measured as a multiple of 1K.
>pid shared_vm shared_ram private_vm private_ram
>6381 37456K 13788K 457272K 37852K
These are totals of shared memory segments and private memory segments, first virtual memory, and then actual RAM.
The "ps" data is only about a very limited part of what is mapped into the process. In the old classical unix model the TEXT+DATA+STACK was about all a process would use. In a typical process today a lot of the mapped memory is shared library text and data. It looks like this process must have a very large amount of other memory, probably mmap regions or system V shared memory regions.
The virtual memory number is the amount of addressable address range. That can be much more than the RAM number, because many pages can be either on disk or never accessed and never really allocated in RAM.
If you decipher the output of the full procvm tool, you can see the type and the length in pages of each segment in a process.