1847253 Members
3137 Online
110263 Solutions
New Discussion

Re: memory puzzle!

 
SOLVED
Go to solution
leelangco_1
Frequent Advisor

memory puzzle!

when i use swapinfo -atm ,output is:
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 12582912 0 12582912 0% 0 - 1 /dev/vg00/lvol2
reserve - 454624 -454624
memory 6373012 3033380 3339632 48%
total 18955924 3488004 15467920 18% - 0 -
the swap reserver for process is 454Mb

the out put of TOP:
Memory: 403504K (298180K) real, 512236K (368448K) virtual, 4107416K free

403504/1024/1024=1.5Gb for all process of the system

i know that when starting a process,the system will reserve swapspace for that,my question is that 1.5gb phy-memory has been used by process,why the swap reserve for that is only 454Mb ? does it means some process must not swap out? is the 1.5Gb phy-memory contains databuffercache?

thank you!
11 REPLIES 11
Venkatesh BL
Honored Contributor

Re: memory puzzle!

There is no swap space reserved for file-backed shared space allocation. Typically, all binaries and shared libraries fall into this category. That is why you are seeing this difference.
sreekanthtm
Trusted Contributor

Re: memory puzzle!

Hi,

There will not be swap space reserved for kernel also(and other process which cannot be swaped out).

The o/p given is not swapinfo -atm, because its shows space in MB.

Rgds
Sreekanth
Ganesan R
Honored Contributor

Re: memory puzzle!

Hi,

Where you are seeing the physical memory usage of 1.5GB?

The cumulative value of memory usage includes both user process + system process.

Again system process includes many things like kernel text data, Dynamic Arenas, Static tables and more importantly Buffer cache. Most cases Buffer cache would be the default value of 50% max. Those memory will not reserve swap.

You can use tools like kmeminfo to see the memory usage in details..
Best wishes,

Ganesh.
Frank de Vries
Respected Contributor

Re: memory puzzle!

I posted a more or less similar question like that about a year ago.

see the responses I got may shed some more light:

http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1198658

Look before you leap
leelangco_1
Frequent Advisor

Re: memory puzzle!

to Ganesan R

when i use top

it reports that :

Memory: 403504K (298180K) real, 512236K (368448K) virtual, 4107416K free

so 1.5Gb phy-memory=403504*4k/1024/1024

i don't kown what does "512236K (368448K) virtual" mean ? the virtual means what?is that swap ?
Venkatesh BL
Honored Contributor
Solution

Re: memory puzzle!

Consider a simple binary file for example. The total 'text' size of it may be 10MB. But, during runtime it may not refer to all of them. So, you could end up having just 1MB (referenced portion) of text in RAM. Here, 10MB is 'virtual', 1MB is 'real'.
leelangco_1
Frequent Advisor

Re: memory puzzle!

i have another quesiton about swap:

TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 12582912 0 12582912 0% 0 - 1 /dev/vg00/lvol2
from the above report,i see used pct is %0
does that means the system swap nothing to the disk ,that is no process have been swapped out?

does the seelping process use memory?
Ganesan R
Honored Contributor

Re: memory puzzle!

See the memory details from top output.

top
System: opie1 Sat Dec 18 22:10:07 2004
Load averages: 3.39, 4.42, 4.54
193 processes: 155 sleeping, 38 running
Cpu states:
LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
3.39 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%

Memory: 515216K (441660K) real, 1537516K (1434024K) virtual, 1365132K free

^ ^ ^ ^ ^

| | | | |

1 2 3 4 5
Memory is not all of physcial, memory, it is:
Total physical memory in the system DEDICATED to text, data or stack segments for all processes on the system.
Total physical memory for runnable processes, as opposed to sleeping processes.
Total memory dedicated to text, data or stack segments for all processes on the system. Some of this is paged out to disk (that is, not all of this is in current physical memory.)
Total memory for runnable processes, as opposed to sleeping or stopped processes.
Physical memory the system considers to be unused and available to new processes. When this value is low, swapping is likely to occur.
For more about top, see top(1) man page.
Best wishes,

Ganesh.
Venkatesh BL
Honored Contributor

Re: memory puzzle!


> from the above report,i see used pct is %0
does that means the system swap nothing to the disk ,that is no process have been swapped out?

It means that no process is swapped out as of now. It could have happened in the past.


> does the seelping process use memory?

A Sleeping process is not a 'dead' process. Of course it will use memory!
Ganesan R
Honored Contributor

Re: memory puzzle!

Hi,

This will clear your dobut hopefully..

swapinfo description and example...
Use 'swapinfo -tm' to get a complete/total picutre of swap usage (see below for example and details.) Pay particular attention to the total line as it indicates how much swap space has been actually reseved for swap. When this percentage gets near 100%, processes will not start up (unable to fork process) and new shared memory segments can not be created.


swapinfo -tm example and explanation:


Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 288 83 205 29% 0 - 1 /dev/vg00/lvol2
reserve - 141 -141
memory 102 41 61 40%
total 390 265 125 68% - 0 -


dev line(s):

are the actual physical swap device(s)
show if swapping has actually occurred. In other words, the PCT USED column in the dev lines represents the value last attained during a previous period of swapping. This is analogous to the high-water mark that a flood leaves.
to check to see if swapping is currently occuring, use 'vmstat -v 5 5' to see if the 'po' (page outs) is sustained above 0.

reserve line(s)

indicate how much of the swap device(s) has(have) been set aside for memory should it need to be swapped.

memory line:

indicative of how much of pseudo-swap has been reserved
when present, indicates pseudo-swap is enabled (i.e. swapmem_on kernel paraemter is set to 1, which is the default.) The size of pseudoswap is calculated to be 75% of the size of RAM (a.k.a. memory.) In other words, it does not refer to acual physical memory use!!!! Pseudo-swap was designed specifically for large memory systems for which acutal swapping is never (or rarely) expected to occur, so thereâ s less need to use actual physical disk space for swap. For more information, see swapmem_on(5) , which reads:

In previous versions of HP-UX, system configuration required sufficient physical swap space for the maximum possible
number of processes on the system. This is because HP-UX reserves swap space for a process when it is created, to
ensure that a running process never needs to be killed due to insufficient swap.
This was difficult, however, for systems needing gigabytes of swap space with gigabytes of physical memory, and those
with workloads where the entire load would always be in core. This tunable was created to allow system swap space to
be less than core memory. To accomplish this, a portion of physical memory is set aside as 'pseudo-swap' space.
While actual swap space is still available, processes still reserve all the swap they will need at fork or execute time from
the physical device or file system swap. Once this swap is completely used, new processes do not reserve swap, and
each page which would have been swapped to the physical device or file system is instead locked in memory and
counted as part of the pseudo-swap space.
total line:
the PCT USED value shown in the total line indicates how much swap space has been actually reseved for swap. When this percentage gets near 100%, processes will not start up (unable to fork process) and new shared memory segments can not be created.






Best wishes,

Ganesh.
leelangco_1
Frequent Advisor

Re: memory puzzle!

very helpful!

thank you all !