- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: What is the Command to monitor process memory ...
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
Discussions
Discussions
Discussions
Forums
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
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
тАО10-18-2007 10:14 PM
тАО10-18-2007 10:14 PM
Whether "top" is not the right command to monitor memory, if so any other command is there for to monitor memory.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 12:11 AM
тАО10-19-2007 12:11 AM
Re: What is the Command to monitor process memory usage
Use glance to monitor it
glance->process list-> select process (S)
You can see memory by process
Regards
L-DERLYN
- Tags:
- glance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 12:22 AM
тАО10-19-2007 12:22 AM
SolutionOnly when the library layer decides to give memory back to the underlying OS will you see the application shrink. Windows libraries may just do that more aggressively, is all. For the Unix libraries, they're likely (I say this because I certainly didn't write all the libc / libc++ variants out there by any means) more worried about virtual address space management than physical. First, there's no guarantee an object of a particular size touched all the underlying pages anyway, and second -- the OS will page out objects in the application or the library (since it neither knows nor cares where the library thinks the ownership is) if it needs/wants more memory anyway. Only the virtual address layout/limitations of the application itself matter... and the caching benefits outweigh (strongly in most cases) the overhead of tossing memory down to the OS layer on every free().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 12:54 AM
тАО10-19-2007 12:54 AM
Re: What is the Command to monitor process memory usage
#export DISPLAY
#gpm
You will be able to see memory usage more clearly..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 01:00 AM
тАО10-19-2007 01:00 AM
Re: What is the Command to monitor process memory usage
# /usr/local/bin/processmem lpsched
Memory claimed by lpsched: 12772 Kbytes.
# cat /usr/local/bin/processmem
#!/bin/sh
# processmem - display memory claimed by a process
#
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"
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 03:37 AM
тАО10-19-2007 03:37 AM
Re: What is the Command to monitor process memory usage
The underlying system call, sbrk(), does allow a negative "growth" and thus it is possible to shrink memory BUT using sbrk() means that you take full control of memory allocation and do not use malloc(), calloc(), realloc() et al or constructors that allocate memory. The execeptions I alluded to earlier do change the behavior of free() to see if the block is the last on the heap and if so will do a negative sbrk() --- but that is the exception.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 04:09 AM
тАО10-19-2007 04:09 AM
Re: What is the Command to monitor process memory usage
sbrk() is doable, but much less flexible. [You can have holes in the heap with the private mmap() model in a manageable fashion... let the OS worry about refilling the holes for you when you map a new object, etc.]
- Tags:
- mmap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 07:19 AM
тАО10-19-2007 07:19 AM
Re: What is the Command to monitor process memory usage
>Clay: et al or constructors that allocate memory.
If you define your own operator new/delete, you can do anything you want to allocate/deallocate memory. Even use mmap private as Don suggested. For STL containers, you can define your own allocator class.
- Tags:
- containers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2007 10:09 PM
тАО10-21-2007 10:09 PM