- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Virtual 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
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
тАО11-04-2007 11:18 PM
тАО11-04-2007 11:18 PM
I'm want to do a script to monitorize virtual memory of an sprecific process.
Any commands/ideas will be great!!!
Can I use "memstat" in HP_UX or is it just for solaris?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2007 11:30 PM
тАО11-04-2007 11:30 PM
Re: Virtual Memory
Depending on your exact needs, maybe the output of ps could already be helpful. When using '-l' (that's a lowercase L) you will get a SZ-field, described in the manpage:
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
I don't know if that's good enough for your reporting needs, but it could be an 'easy way'.. note that memory on unix machines is a complicated area :)
Cheers,
Wout
- Tags:
- PS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2007 11:34 PM
тАО11-04-2007 11:34 PM
Re: Virtual Memory
memstat for solaris only. but you can use
UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o comm
Hasan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-05-2007 01:49 AM
тАО11-05-2007 01:49 AM
Re: Virtual Memory
I'm afraid ps is not very useful cause i need virtual memory, not physical.
Hasan: I don't understand your command...
^_^
I've also read glance is useful.
Any other ideas will be of great help ;)
- Tags:
- glance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-05-2007 02:08 AM
тАО11-05-2007 02:08 AM
Re: Virtual Memory
> I'm afraid ps is not very useful cause i need virtual memory, not physical
Huh? Do you care where the process's memory really exists --- in physical RAM; versus paged out in swap? What matters is the overall memory footprint for a process.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-05-2007 02:18 AM
тАО11-05-2007 02:18 AM
Re: Virtual Memory
if you want to monitor process=1200 then
while true
do
UNIX95= ps -eo "pid vsz=Kbytes" | grep 1200 | awk '{print $2}' >> logfile
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-05-2007 02:19 AM
тАО11-05-2007 02:19 AM
Re: Virtual Memory
while true
do
UNIX95= ps -eo "pid vsz=Kbytes" | grep 1200 | awk '{print $2}' >> logfile
sleep 60
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-05-2007 03:26 AM
тАО11-05-2007 03:26 AM
SolutionYou can tell glance to log this to a file, but you have to create a file with some adviser commands.
Quick and dirty example file (let's name the file 'syntaxfile'):
--CUT HERE--
process loop {
if proc_proc_name == "top" then
print gbl_stattime,proc_proc_id," ",proc_proc_name,proc_mem_virt
}
--CUT HERE--
This example, as you can probably figure out, will tell glance to select processes named "top" and print their PID, name and VSS (virtual set size, which you wanted to know), prepended by the time.
In order to run glance with this information, you could run:
# glance -adviser_only -syntax syntaxfile > outputfile
You could run this in the background if you want, and specify the interval (-j), number of iterations (-iterations) or other common glance options.
When I run the above while a top is running on the machine, my output file looks like this:
17:22:29 4073 top 5.2mb
17:22:34 4073 top 5.2mb
17:22:39 4073 top 5.2mb
...
More info in 'man glance' and more examples in /opt/perf/examples/adviser.
Hope that helps,
Cheers,
Wout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-05-2007 03:49 AM
тАО11-05-2007 03:49 AM
Re: Virtual Memory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-05-2007 09:29 PM
тАО11-05-2007 09:29 PM