Operating System - OpenVMS
1828225 Members
2532 Online
109975 Solutions
New Discussion

Re: How to get dynamic memory information from another running process?

 
SOLVED
Go to solution
Davor_7
Regular Advisor

How to get dynamic memory information from another running process?

i know the running process's id/name.
my login account has the all privilege.

i want to know the dynamic memory usage for this running process after my account login.
how can i do that?
29 REPLIES 29
Karl Rohwedder
Honored Contributor

Re: How to get dynamic memory information from another running process?

Have you looked at the lexical function F$GETJPI(PID,ITEM)?
It allows to gather much info from processes including e.g. the varias working set sizes, virtualpagecount ...

regards Kalle
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

yes.
now i have known how to get the physical memory usage of a process.
but how to know a dynamic memory usage ?
no idea...
David B Sneddon
Honored Contributor

Re: How to get dynamic memory information from another running process?

Davor,

Can you explain exactly what _YOU_ mean by
"dynamic memory information"?

Dave
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

i mean how many dynamic memory the running process uses.
for your own process, you can type $sho proc/mem to show the PDMA. but how to know the value from another process which you donot own?

also, is there any value-related between dynamic memory and physical memory?
the physical memory i calculated is far more then the dynamic memory...
David B Sneddon
Honored Contributor

Re: How to get dynamic memory information from another running process?

What problem are you trying to solve?
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

i use this command to get the physical memory utilizaion and calculate all the independant process
$ mem=F$GETJPI(pid,"PPGCNT")+F$GETJPI(pid,"GPGCNT")
as HP says, the result for this command is a unit of "page", you know 1 page = 8KB in alpha
so, i summarize the whole result but see it's >100G. the physical memory in my node is just <10G... how come?
this is my problem...
Volker Halle
Honored Contributor

Re: How to get dynamic memory information from another running process?

Davor,

PPGCNT (process private pages) and GPGCNT (process global pages) are measured in PAGELETS = 512 bytes, the size of the old VAX page.

Global pages are also shared between multiple processes and a global page mapped by multiple processes only exists ONCE in physical memory, so you can't add those numbers.

The term 'dynamic memory' actually refers to the Process Dynamic Memory Area shown by SHOW PROC/MEMORY, which is a process-private pool of memory in P1 space.

Volker.
David B Sneddon
Honored Contributor

Re: How to get dynamic memory information from another running process?

Firstly, the counts returned in PPGCNT and GPGCNT
do not necessarily reflect physical memory usage.
Secondly, by counting the GPGCNT for every process,
you are ignoring the fact that the global pages are
likely to be shared... and should therefore NOT
be counted multiple times.
You also need to take into account that pages are
not necessarily in memory but may be in a pagefile
or other disk file (images).
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

you mentioned that:
PPGCNT (process private pages) and GPGCNT (process global pages) are measured in PAGELETS = 512 bytes, the size of the old VAX page.

but from HP.
it says that it's the "page" unit
pls refer to:
For a given process with PID in the symbol "pid", the total number of pages
currently in the working set is:

$ mem=F$GETJPI(pid,"PPGCNT")+F$GETJPI(pid,"GPGCNT")
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

To david & Halle

yes. global pages are shared.
but even if i only calculate with the private pages. it's also very huge...
David B Sneddon
Honored Contributor

Re: How to get dynamic memory information from another running process?

Yes the number may be huge, but you are ignoring
the fact that pages in the working set may not
be physically in memory.
Volker Halle
Honored Contributor

Re: How to get dynamic memory information from another running process?

Davor,

please have a look in the System Services Manual for explanation of the arguments to the $GETJPI system service:

JPI$_PPGCNT
Returns the number of pages (on VAX systems) or pagelets (on Alpha and I64 systems) the process has in the working set. This is a longword integer value.

These are the process-private pagelets in the process working set, so they WILL be in physical memory at that time.

Volker.
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

To Halle
all right, now we have 2 versions for the PPGCNT output, hehe. manual says it's pagelet but HP website says it's page... which is the correct?
and btw, if i do the calculation for all the process, i believe the physical memory size for total process is beyond the physical memory for the alpha machine...


To david
as you said, the pages in working set are not physically in the memory at all.
i lost my way... if it's true, how to know how many physical memory a process uses ??(return to the original question, hehe)
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

Hi Halle,

i target the service manual...
so i think maybe the words on HP website is suitable to VAX (cannot say it's wrong...)

thanks~

now i'm confused with what David said... the pages in working set are not all physically in the memory
do you have any idea?
Volker Halle
Honored Contributor

Re: How to get dynamic memory information from another running process?

Davor,

terminology around pages/pagelets can sometimes be confusing, if you consider the 3 different architectures OpenVMS is running on.

From the IDSM (OpenVMS Internals and Datastructures Manual - Chapter 19):

The term working set refers to the virutal pages of a process that are currently valid and in physical memory.

And let's ask again: what is the problem your're trying to solve ? Is there a real problem ?

Volker.
David B Sneddon
Honored Contributor

Re: How to get dynamic memory information from another running process?

Yes, working set is a Volker states (my error).
This question has been asked in comp.os.vms and
I am trying to find an answer I remember seeing
that describes the situation very, very clearly.
I will post the link if I can find the article.
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

it's a performance problem
we will do a improvement which will cause many new process to run on the system. regard to the physical memory i wanna confirm whether the change can be implemented.

btw, do you have the soft copy of IDSM (OpenVMS Internals and Datastructures Manual) ? i cannot find it in the web...

and also, you mentioned:
The term working set refers to the virutal pages of a process that are currently valid and in physical memory.
my understand is that the size of working set(pagelet) is equal to the consumption of physical memory, is that correct?
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

thanks David,

very looking forward to your link...
Volker Halle
Honored Contributor

Re: How to get dynamic memory information from another running process?

Davor,

the IDSM is a book from Digital Press, that you need to buy (ISBN 1-55558-120-X).

The working set is made up by process private and global page(let)s. If you will create a lot of new processes (of the same type and memory usage charateristics), you could expect the physical memory usage to increase by times .

Consider to use SYS$EXAMPLES:WORKING_SET.COM and modify it to also print PPGCNT and GPGCNT.

Volker.
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

for my previous question.
can i calculate the working set page(let) to be the physical memory utilization ?
Volker Halle
Honored Contributor
Solution

Re: How to get dynamic memory information from another running process?

Davor,

PPGCNT = process-private page(lets) in the process working set are REAL physical page(let)s used by this process at that time.

GPGCNT = global page(lets) in the process working sets are also PHYSICAL page(lets), BUT they can be used/mapped to by other processes at the same time.

If you would use the sum of PPGCNT+GPGCNT for all processes, you would over-estimate physical memory by ignoring the sharing effect of the global pages.

If you know the size of the global section(s) used by those processes, you could use the sum of all PPGCNT of all processes + the size of the global section(s). This would be the most correct approximation of physical memory usage for those processes.

Volker.
Davor_7
Regular Advisor

Re: How to get dynamic memory information from another running process?

thanks!
btw, do you have an good way to calculate the total shared GPGCNT? so that the physical memory usage could be more accurate
Volker Halle
Honored Contributor

Re: How to get dynamic memory information from another running process?

Davor,

trying to sum up the GPGCNT values does not make sense. A total count of 70 could represent 70 processes mapping one and the same page(let) or 70 different page(let)s. In terms of physical memory used, this could mean anything between 1 or 70 pages, you can't tell.

If you increase the no. of processes of the same application type, you don't need to worry about the global pages.

Volker.
Ian Miller.
Honored Contributor

Re: How to get dynamic memory information from another running process?

SHOW PROC/MEM shows statistics about the process dynamic memory area. The size of this is controlled by CTLPAGES. The amount in use is in CTL$GL_PRCALLCNT which can be examined in SDA.

This area is used for process logical names, and various other things.
____________________
Purely Personal Opinion