Operating System - HP-UX
1748060 Members
5561 Online
108758 Solutions
New Discussion

Substitue of PMAP in 11.23

 
SOLVED
Go to solution
abhishekjain_48
Advisor

Substitue of PMAP in 11.23

Hi ,

 

I am trying to find memory usage of a particular processid.

In 11.31 i can use pmap <pid> to get memory usage of process(including size of each mapped object).

 

Is there any substitute of pmap in 11.23.

 

Actually, I want to know Total virtual size of the process including virtual sizes of text, data, stack, mmap regions, shared memory regions and IO mapped regions.

 

I already tried ps command (in combination woth some options) but not usefull.. :(

 

Please help.

 

Regards

Abhishek J

5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: Substitute for pmap(1) in 11.23

>Is there any substitute of pmap in 11.23?

>I already tried ps command (in combination with some options) but not useful.

 

Any reason you need this level of detail?  Won't ps(1) and top(1) give a good estimate?

 

Otherwise you can write your own pmap by calling the appropriate pstat(2) functions.

If you search in the HP-UX category, there may already be a source attached to one topic.

 

 

abhishekjain_48
Advisor

Re: Substitute of PMAP in 11.23

Hi Dennis

I have some processes that are eating up so much memory causing the component crash.

 

I found its a TAO process and consuming so much memory causing TAO crash ... so i want to know the memory usage of that TAO process so that I can re-start TAO before crash depending if memory usage reaches a certain limit..

 

top i s not usefull for my case as top wil list the top processes on the system and TAO process might not get listed in TAO output.

 

It would be very usefull if you can provide the code that you are refering to or link to that post

Thanks in advance

 

Regards

AbhishekJ

Dennis Handly
Acclaimed Contributor
abhishekjain_48
Advisor

Re: Substitute for pmap(1) in 11.23

I could find some code at :

 

http://h30499.www3.hp.com/hpeb/attachments/hpeb/itrc-156/378200/1/357495.c

 

but i was looking for shell script to get the details fo process size...

i tried using ps but ps will only tell  size in physical pages but i am looking to get Total virtual size of the process  including virtual sizes of text, data, stack, mmap regions, shared memory regions and IO mapped regions as we got in TOP output.

 

Regards
AbhishekJ

Dennis Handly
Acclaimed Contributor
Solution

Re: Substitute for pmap(1) in 11.23

>I could find some code at: 357495.c

 

You want to look at the code around pstat_getprocvm.

 

>I tried using ps but ps will only tell  size in physical pages

 

There is the vsz field in KB.

Since your comparison is going to be fuzzy anyway, you are going to have to adjust your limits until your are happy.

What did you use for pmap?

 

>I am looking to get Total virtual size of the process  including virtual sizes of text, data, stack, mmap regions, shared memory regions regions as we got in TOP output.

 

The text and stack sizes shouldn't be a limit.  If you have a leak, the only one that counts is the data area.

And if you like top output, you can just use "-d 1 -n 10000 -f top.out" and look at that.