- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Command to find 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
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
тАО06-06-2006 06:44 AM
тАО06-06-2006 06:44 AM
I want to know the command to find out the total use of memory (RAM) without using the Glance or GlancePlus ?
Is there a command available for this ?
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 06:49 AM
тАО06-06-2006 06:49 AM
SolutionTo Show Free memory on system:
# vmstat 1 2 | tail -1 | awk '{printf "%d%s\n", ($5*4)/1024, "MB" }'
To Show Top Memory Processes:
# UNIX95= ps -el -o pid,comm,sz | grep -i -v pid | sort -nr -k 3,3 | head -15
This shows the top 15 processes for memory utilisation.
# vmstat 1 1000 >> /tmp/vm.out
This will collect 1000 samples of vmstat output with an interval of 1 sec
# vmstat 1 >> /tmp/vmstat.out
The above command keeps collecting the vmstat output infinitely
regards;
mustafa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 08:20 AM
тАО06-06-2006 08:20 AM
Re: Command to find memory usage
I respectfully submit swapinfo -tam as an alternative.
sar can be used to monitor various figures concerning memory use.
I also know I owe you an email. Personal situation is a bit hairy right now. Don't worry, I'll get to it.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 08:40 AM
тАО06-06-2006 08:40 AM
Re: Command to find memory usage
# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 0 1024 0% 0 - 1 /dev/vg00/lvol2
dev 1024 0 1024 0% 0 - 1 /dev/vg00/swap02
dev 512 0 512 0% 0 - 1 /dev/vg00/swap03
reserve - 130 -130
memory 1469 533 936 36%
total 4029 663 3366 16% - 0 -
# vmstat 1 2 | tail -1 | awk '{printf "%d%s\n", ($5*4)/1024, "MB" }'
1130MB
#
Why there is too much difference between 2 command output ?
In the output of "swapinfo -tam" Is 4.029GB total available RAM or 1.469GB ?
Thanks,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 08:57 AM
тАО06-06-2006 08:57 AM
Re: Command to find memory usage
swapinfo will show swap space usage.
Also sar will not show memory usage in HP [ In solaris sar -r shows memory usage :) ]
So you have only the following options
Glance - which you do not want to use [ I dont know why ]
vmstat - as suggested above or
UNIX95= ps -e -o "sz" | awk 'BEGIN {tot=0} {tot+=$1} END {print tot*4/1024,"MB"}'
I dont remember if there is any text appearing in the first line in output of
UNIX95= ps -e -o "sz"
Please check - if text appears in 1st line then modify above as
UNIX95= ps -e -o "sz" | tail +2 | awk 'BEGIN {tot=0} {tot+=$1} END {print tot*4/1024,"MB"}'
But again as there are shared memory segments which may be shared by multiple processes the memory calculated as above is approximate. You can compare with Glance once.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 03:44 PM
тАО06-06-2006 03:44 PM
Re: Command to find memory usage
You should read this paper to understand how memory is used by HP-UX,
ftp://eh:spear9@hprc.external.hp.com/memory.htm
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 04:46 PM
тАО06-06-2006 04:46 PM
Re: Command to find memory usage
# echo "freemem/D" | adb -k /stand/vmunix /dev/kmem
The output is the free memory in pages. Multiply the resulting number with 4 to get the free memory in Kbytes.
# echo "phys_mem_pages/D" | adb -k /stand/vmunix /dev/kmem
The output is the total memory in pages.Multiply the resulting number with 4 to get the free memory in Kbytes.
Used memory=Total memory-Free memory
grep -i physical /var/adm/syslog/syslog.log ---> To get physical RAM on system.
You can use this tool also:
/usr/contrib/Q4/bin/kmeminfo
-AMit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 01:12 PM
тАО06-07-2006 01:12 PM
Re: Command to find memory usage
Thanks for the link provided to me. It is very useful.
Regards,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 04:22 PM
тАО06-07-2006 04:22 PM
Re: Command to find memory usage
"Easy command line way to check memory usage"
http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0xa56442308663d611abdb0090277a778c%2C00.html&admit=-682735245+1149740463211+28353475