- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Resident memory usage (whitout top)
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
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-07-2001 06:42 AM
08-07-2001 06:42 AM
MDF
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 07:04 AM
08-07-2001 07:04 AM
Re: Resident memory usage (whitout top)
I would do something like this:
UNIX95= ps -p ${MYPID} -o "args,vsz,sz"
vsz is the size in KB of the core image and sz in the total number of text,data, and stack pages of the process. The space after UNIX95= is required.
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 07:29 AM
08-07-2001 07:29 AM
Re: Resident memory usage (whitout top)
MDF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 07:34 AM
08-07-2001 07:34 AM
Re: Resident memory usage (whitout top)
You can use the below commands
sar -o sarfile 2 2 # Produces a binary sarfile
sar -Af sarfile > sar.report
You can get the process resident statistics in the report file.
...PRB...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 07:48 AM
08-07-2001 07:48 AM
Re: Resident memory usage (whitout top)
start glance
select 's' for process
entry the pid
If you are using the gui version of glance
start gpm
select reports
process list
click on the process name
select reports
process memory regions
for further info.
select reports again
process resources
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 07:48 AM
08-07-2001 07:48 AM
Re: Resident memory usage (whitout top)
To sort the process based on the resided memory sizes,
UNIX95= ps -e -o vsz=Kbytes -o pid,args=Command-Line|sort -rnk1
you can put this in your .kshrc as a variable as well. For eg:
psmem="UNIX95= ps -e -o vsz=Kbytes -o ruser,pid,args=Command-Line|sort -nrk2"
(once you source your .kshrc, then just run psmem and it will list out your process sorted through the resident memory sizes-the output will list the size, loginid, pid, process name).
To just look for a process do a
psmem |grep $PID
-HTH
I am RU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 08:11 AM
08-07-2001 08:11 AM
Re: Resident memory usage (whitout top)
Please disregard my previous post, it does not list you the RSS of the process, like clay said, vsz lists the size of the core image of the process and sz lists the size in physical pages of the core image including text, data and stack space.
Some of the other options is to use the -d option for top and grep for the RSS value. or like nancy said, you might have to use glance.
The question i had is are you trying to achieve this in a script?
-Regards
I am RU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 08:19 AM
08-07-2001 08:19 AM
SolutionWithout top or Glance, you will have to do this with c using the pstat_getdynamic() function to get an array of processes and then using the pstat_getproc() to loop through the
array until you find your pid. The pst_status struct contains the data you want although at best it is an approximation since this data is constantly changing.
Someone may have written a perl module to do this but since it is so easy in C that whenever I've needed to do anything like this, I can usually whip it up in a few minutes.
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 09:36 AM
08-07-2001 09:36 AM
Re: Resident memory usage (whitout top)
if you can find a "quite" time on your system, where no
(or almost no) processes are started anew, try to do
something like
vmstat 1 10
start-your-process-here
vmstat 1 10
"vmstat" usually needs a few seconds to "settle", so
doing it ten timesshould take care of that ;-)
And, well, if nothing else is started in between the two
"vmstat" commands, just subtract the averages of the,
say, last 3 of each of them.
The column you are interested in is "free" and its unit
is in "pages" of course, which usually are 4096bytes
each (check with "chatr" onto the codefile of your
process).
Not really precise, but it should give you an idea about
it ;-)
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2001 10:53 AM
08-07-2001 10:53 AM
Re: Resident memory usage (whitout top)
$ ps -elf |grep Proc_name |grep -v grep |awk '{print $10}'