- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Easy command line way to check 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
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
тАО05-13-2002 11:59 AM
тАО05-13-2002 11:59 AM
I know that I can see this in Glance, but I want the actual command so that I can put in ina script and run it from cron once per hour for a few weeks.
I have looked at sar, but it does not seem to have real memery usage info, just swap space and paging. I look at pstat also, but it seems way to complex for my needs.
Any simple, one line solutions???
Thanks, Jeanine
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2002 12:05 PM
тАО05-13-2002 12:05 PM
Re: Easy command line way to check memory usage
Try,
vmstat -n 1 10
top
Check out RSS. This is the Real memory (resident set) size of the process, in 1024 byte units.
Hope this helps.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2002 12:19 PM
тАО05-13-2002 12:19 PM
Re: Easy command line way to check memory usage
You can also try,
UNIX95= ps -e -o "user,vsz,pid,ppid,args"
here vsz -> Size in KB of the core image of the process.
you can sort the above output too,
UNIX95= ps -e -o "user,vsz,pid,ppid,args" |sort -rkn2 |more
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2002 12:28 PM
тАО05-13-2002 12:28 PM
Re: Easy command line way to check memory usage
# glance -m -j 5 -iterations 2 -f /tmp/output > /dev/null
-m = just memory screen
-j 5 = ev 5 sec
-iterations 2 = # iterations
-f /tmp/output = output to file /tmp/output
Direct all to null so that it does not show up in std output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2002 12:32 PM
тАО05-13-2002 12:32 PM
Re: Easy command line way to check memory usage
Hello,
I like to use
top -h -d 1
and look at Memory from there.
Thanks,
-Yates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2002 12:41 PM
тАО05-13-2002 12:41 PM
Re: Easy command line way to check memory usage
As Sanjay suggested vmstat is fine. However if you have meassureware and perf view installed please let me know and I can suggest a method where you do not need to have a cron job and get the data.
Thanks
Regards
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2002 12:41 PM
тАО05-13-2002 12:41 PM
Re: Easy command line way to check memory usage
Since you have Glance, let's use the mwaget command-line interface.
I assume that /opt/perf/bin is in your PATH.
e.g.
mwaget -metric "SCOPE:(GLOBAL):GBL_MEM_UTIL"
(Percentage global memory utilization during the sampling interval.)
mwaget -metric "SCOPE:(GLOBAL):GBL_MEM_FREE_UTIL"
(Percentage global memory free during the sampling interval.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2002 01:20 PM
тАО05-13-2002 01:20 PM
SolutionPRINT "System Memory: ", gbl_mem_sys
PRINT "Buffer Cache: ", gbl_mem_cache
PRINT "User Memory: ", gbl_mem_user
PRINT "Free Memory: ", gbl_mem_free
PRINT "-------------------------------"
PRINT "Total Physical Memory: ", gbl_mem_phys
then you can get a nice memory usage summary by running:
glance -adviser_only -syntax mem.syntax -j 1 -iterations 2 2>/dev/null | tail -6
The metrics listed above (gbl_mem_xxxx) can also be used with Clay's suggestion.
Other Measureware and Glance metrics are listed in
/opt/perf/paperdocs/mwa/C/metrics.txt
and
/opt/perf/paperdocs/gp/C/metrics.txt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2002 01:33 PM
тАО05-13-2002 01:33 PM
Re: Easy command line way to check memory usage
You can also use Glance in "adviser only" mode to log any performance metrics every hour for 7 days.
For example, with the same mem.syntax file in your current directory, run:
nohup glance -adviser_only -syntax mem.syntax -j 3600 -iterations 168 -f glance.out &
In this case I would also include the timestamp header in mem.syntax:
PRINT " ", gbl_statdate, " ", gbl_stattime
PRINT "------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2002 01:37 PM
тАО05-13-2002 01:37 PM
Re: Easy command line way to check memory usage
If you want something like this :
Memory Stat total used avail %used
physical 32764.0 24296.4 8467.6 74%
active virtual 16899.8 10480.4 6419.4 62%
active real 18039.3 10747.2 7292.1 60%
memory swap 26522.5 19504.4 7018.1 74%
device swap 3332.0 3332.0 0.0 100%
you may like to compile a simple c program attached whihc i got from these forums too . Just do a cc filename and you will get a exe which can be run from the command line.
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2002 05:20 AM
тАО05-15-2002 05:20 AM
Re: Easy command line way to check memory usage
Jeanine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2002 03:42 AM
тАО10-22-2002 03:42 AM
Re: Easy command line way to check memory usage
Please try this one-liner...
grep Physical /var/adm/syslog/syslog.log
All the best...
Regards,
Dinesh Ramaswamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2002 03:57 AM
тАО10-22-2002 03:57 AM
Re: Easy command line way to check memory usage
answer: write yourself a program/script that will output such.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2002 09:31 AM
тАО10-22-2002 09:31 AM