Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

how to calcute in used memory

 
SOLVED
Go to solution
edward wang_1
Frequent Advisor

how to calcute in used memory

in vms, when show mem, has a item In used memory display,how to calcute in uesed mem? when show system/full, we can see each process to hold memory, are these in used memory in totally?
4 REPLIES 4
Phil.Howell
Honored Contributor

Re: how to calcute in used memory

I will be corrected on this, but here goes..

show sys shows a value for pages of memory for each process, but this is made up of processpages and globalpages, the globalpages can be shared.

You should run the example procedure
working_set.com from the vms performance management manual.
Phil
edward wang_1
Frequent Advisor

Re: how to calcute in used memory

actually, I meaning is which parts can buildup and calculate out in used memory in system when show mem display
Hoff
Honored Contributor
Solution

Re: how to calcute in used memory

Memory usage is a slippery concept on a modern virtual memory system. It seems simple, then you start getting into the various paging structures and memory sharing and such.

Virtual memory and physical memory and modified list activity and shared (global) memory can all apply to the calculation.

At its simplest, the following is the approximate memory usage:

F$GETJPI(PID,"PPGCNT") + F$GETJPI(PID,"GPGCNT")

The value shown will probably be high, and particularly if the global pages are shared with other processes. And the value does not account for the modified list and such.

Here's another answer, for virtual memory:

F$GETJPI(PID,"VIRTPEAK")

And for the working set:

F$GETJPI(PID,"WSSIZE")

F$GETJPI(PID,"WSPEAK")

Here's one tool -- and which shows examples of some of the above DCL lexical calls -- over at OpenVMS.org:

http://dcl.openvms.org/stories.php?story=03/06/03/0022504

There are other tools around.

Here are some write-ups on OpenVMS and its virtual memory that might interest you, depending upon what you are up to here:

http://64.223.189.234/node/494
http://64.223.189.234/node/228
http://64.223.189.234/node/461
http://64.223.189.234/node/538
http://64.223.189.234/node/131

If you're debugging memory use and a process memory leak, I have some materials on that topic posted, too.

And there's the classic "buy more memory" discussion, or the "you have to plug the memory leak", depending on the trigger. Memory prices continue to drop, and memory leaks will continue to leak until the process is restarted, or the leak is plugged.

Stephen Hoffman
HoffmanLabs LLC
John Gillings
Honored Contributor

Re: how to calcute in used memory

edward,

Phil is correct. Memory use in OpenVMS isn't a simple matter of adding up numbers. Each process has some combination of private and global memory, plus memory mapped to page and/or swap file(s), possibly plus memory mapped to other files, plus "yet to be realised" memory (demand zero pages which haven't been touched yet).

For an individual process you can use F$GETJPI. Look at "PPGCNT", "GPGCNT", "WSSIZE" and "VIRTPEAK". "FREP0VA" and "FREP1VA" can also be worth looking at to see if a process is approaching 32bit limits.

Matching up numbers for individual processes with the overall, sysetm wide picture is non trivial (indeed, it might not be possible, since everything is shifting around as you collect your samples, and the collection itself may affect the results). However, since it's not really useful to do, that really doesn't matter.

Since V7.3, OpenVMS will use any "spare" memory as cache, so SHOW MEM might look a bit alarming with memory usage permanently in the high 90%. Trust that the OS knows how to recover memory from the cache when required. OpenVMS generally does a very good job of putting as much memory as possible to good use.

One way of thinking about this is to consider "free" memory to me "wasted" memory. You paid good money for it, so you hope that you get a return on investement.

Perhaps if you explained your objectives?
A crucible of informative mistakes