Real Memmory /Virtual Memory /Physical Memory Accountancy.

Real Memmory /Virtual Memory /Physical Memory Accountancy.

Post by Samik Na » Wed, 05 Sep 2001 18:43:05

Dear Forum!
Any kind person to respond?

I used this program:

#include <stdio.h>
#include <sys/pstat.h>
struct pst_static buf;
struct pst_dynamic dyn;
pstat_getstatic(&buf,sizeof(struct pst_static),1,0);
pstat_getdynamic(&dyn,sizeof(struct pst_dynamic),1,0);
printf("Total  Page Size=%dB\n",buf.page_size);
printf("Total  Phys memory=%dMB\n",buf.page_size/1024*buf.physical_memory/1024);
printf("Total  Virt memory=%dMB\n",buf.page_size/1024*dyn.psd_vm/1024);
printf("Active Virt memory=%dMB\n",buf.page_size/1024*dyn.psd_avm/1024);
printf("Total  Real memory=%dMB\n",buf.page_size/1024*dyn.psd_rm/1024);
printf("Active Real memory=%dMB\n",buf.page_size/1024*dyn.psd_arm/1024);
printf("Free        memory=%dMB\n",buf.page_size/1024*dyn.psd_free/1024);


Output is:

Page Size=4096B
Total  Phys memory=2047MB
Total  Virt memory=597MB
Active Virt memory=333MB
Total  Real memory=665MB
Active Real memory=352MB
Free        memory=263MB

I use HP-UX Release 11.0.

What is it's interpretation? How can I obtain 2047 MB using other
Like Total Phys Memory = Total Real Memory + Total Free Memory or
something like that....
Virtual Memory - Does it have any share in RAM? I knew that it is the
disk space
getting used.
If real memory is 665MB Far less compared to Total Phys Memory then
there is some figure in the account head of Active Virual Memory? I am

I did man vmstat ..It did not said avm - actual virtual pages
I multiply the shown figure with Page Size=4096B? No where unit is
in HP-UX 11.0 documentation.

Waiting eagerly for your reply.

Samik Nath


1. mmap, virtual memory, physical memory

    Help I'm confused! From my readings on the Net and elsewhere it
would appear that the mmap system call is used to map a file into a
process's virtual memory, adding a new region to the address space. But
it seems also that this virtual mapping implies physical mapping  if the
corresponding physical pages are not already loaded (by some other
process), except for the MAP_ANONYMOUS case.
If this is so how can we have a page in a process's address space
(virtual memory) that is not present in physical memory? Of course this
can happen after swapping but initially when loading a program how do
you create its address space (virtual memory) without having all the
regions in physical memory? i.e. How do you provide for demand-paging?

                                Any help appreciated.

2. C++ on Unix 286

3. Is "shared memory" a way to reduce physical memory usage?

4. Apache 1.3 on win95

5. a REAL physical memory access question

6. Booting LINUX from a JAZ drive

7. Physical memory versus detected memory 2.4.7-10

8. a simpler software RAID/partition suggestions?

9. Virtual / Physical memory address access in drivers ? help ?

10. Get Physical and Virtual memory using Forte C++

11. Mapping Physical Memory To Kernel Virtual

12. Physical vs. virtual memory allocation.

13. how to remap the memory on PCI card to a new virtual memory?