Operating System - HP-UX
1849039 Members
5412 Online
104041 Solutions
New Discussion

Re: top and huge virtual memory problem

 
Dejan Donovski
Occasional Advisor

top and huge virtual memory problem

Hi

I have a problem regarding the amount of the virtual memory on rx2600 server with 4GB RAM.
top shows:

Memory: 895972K (162544K) real, 30980256K (4965800K) virtual, 91600K free

and swapinfo shows:
Kb Kb Kb
TYPE AVAIL USED FREE USED
dev 4194304 122896 4071408 3%
reserve - 2462276 -2462276
memory 3103596 2991128 112468 96%

i can see that pseudo-swap is turned on (3GB) an that it is used 96%. However i am confused about the way top calculates the memory.
How can the virtual memory be 30GB when there is 4GB swap space and 4 GB RAM? Where would the memory above the 8GB limit be allocated?
Is the 900MB real memory in the top output,calculated as the ammount of physical memory minus the 3GB (75%) pseudo-swap?
5 REPLIES 5
Bill Hassell
Honored Contributor

Re: top and huge virtual memory problem

top's memory report is almost useless as it does not calculate the numbers in a meaningful way. Most likely you are missing a patch for top, but use swapinfo for this information, but always use swapinfo -tm. The last line is more meaningful. You have 4Gb of swap with 4Gb of RAM so you won't run out of virtual memory until your virtual memory usage hits about 7Gb. Glance is the only program that will give you an accurate picture of memory usage. Note: the majority of "out of memory" errors have nothing to do with RAM or virtual memory.


Bill Hassell, sysadmin
Cem Tugrul
Esteemed Contributor

Re: top and huge virtual memory problem

As an addition to Bill,
Our greatest duty in this life is to help others. And please, if you can't
Steve Steel
Honored Contributor

Re: top and huge virtual memory problem

Hi


Look at

ftp://eh:spear9@hprc.external.hp.com/memory.htm

I. Memory Usage as seen in "dmesg", "swapinfo", "top", "sam", and "glance"


Steve Steel

If you want truly to understand something, try to change it. (Kurt Lewin)
Dejan Donovski
Occasional Advisor

Re: top and huge virtual memory problem

Thanks for your advices,
swapinfo -tm produces:

Mb Mb Mb PCT
TYPE AVAIL USED FREE USED
dev 4096 132 3964 3%
reserve - 2303 -2303
memory 3031 3031 0 100%
total 7127 5466 1661 77%

I can see that there is not enough memory.
The server is running oracle with many processes, however i can not find out exactly
how much memory is alocated by each process
becouse when i do:
UNIX95=1 ps -efo vsz,sz,pid,args
VSZ SZ PID COMMAND
382976 14961 10417 oracleorahp (LOCAL=NO)
382976 15057 12381 oracleorahp (LOCAL=NO)
382976 15082 12580 oracleorahp (LOCAL=NO)
382976 15017 12318 oracleorahp (LOCAL=NO)
382976 14982 12203 oracleorahp (LOCAL=NO)
382976 15040 10759 oracleorahp (LOCAL=NO)
(this is only part of the output)

if i calculate the ammount of virtual memory as number of pages*4096 it turns out that
each of those processes has 1.5GB virtual
memory which is impossible. I guess that for accurate numbers glance must be used.
Steve Steel
Honored Contributor

Re: top and huge virtual memory problem

Hi

get procsize from the website I gave you

c) Can look at shared memory usage by process with an unsupported utility called procsize, which breaks down memory by various types, specifically: UAREA, TEXT, DATA, STACK, Shared Memory, Memory Mapped files.

For example:
Look at breakdown of memory usage, per process:

# ./procsize -fnc | more
pid Comm UAREA TEXT DATA STACK SHMEM IO MMAP Total
2916 getty v 4 5 6 4 0 0 349 369
2287 prm3d v 68 6 671 513 0 0 37212 38471
.
.
.



TRICK: Here's the command to use to sort the processes by total memory usage, most to least.


# ./procsize -fcn |sort -rnk 11 | more


TRICK: Here's the command to use to sort the processes by shared memory usage, most to least.


# ./procsize -fcn |sort -rnk 8 | more


Then you have good figures

I think the oracle uses the SGA so they all show the same 1.5 gig

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)