Operating System - HP-UX
1837785 Members
4005 Online
110119 Solutions
New Discussion

Re: reservation of pseudo-swap space

 
SOLVED
Go to solution

reservation of pseudo-swap space

From "HPUX memory management" (copyright HP)whitepaper:
1. "If no device or file system swap is available, the system uses pseudo-swap AS LAST RESORT."
2. "If physical swap space is EXHAUSTED and no additional file-system swap space can be acquired, pseudo-swap is reserved for the process by descementing swapmem_cnt."

I have tried to check these statements and they do not appear to be correct.
Please see the following scenario:
On freshly booted server where nothing is running except oracle client being installed:

# meminfo
Memory Stat total used avail %used
physical 4096.0 897.9 3198.1 22%
active virtual 351.0 301.9 49.0 86%
active real 196.2 163.4 32.8 83%
memory swap 3260.5 354.7 2905.8 11%
device swap 1024.0 206.5 817.5 20%

using adb checked that :
swapspc_cnt=796.719 MB
swapmem_max=3260.48 MB
swapmem_cnt=2905.72 MB
(all values converted from 4K pages)

From the above we can see that while device swap space is still not exhausted ("swapspc_cnt" far from zero)
pseudo-swap is already allocated ( (swapmem_max- swapmem_cnt) > 300M )

This seems to contradict whitepaper statement.

Is my understanding of whitepaper wrong?

Thank you.
5 REPLIES 5

Re: reservation of pseudo-swap space

Forgot to mention
dbc_pct_max=5 (200m)
sys_mem=514m

Borislav Perkov
Respected Contributor

Re: reservation of pseudo-swap space

Hi,
Please send the output of the swapinfo command.
Regards,
Borislav
Borislav Perkov
Respected Contributor

Re: reservation of pseudo-swap space

The system pretent that it has reserved swap memory, so called pseudo swap, that is because of application need of virtual memory. As far as I know pseudoswap is allocated at system startup and it is approx. 2/3 from the memory.
Or according to the number of started application: if there is 5 applications and they need 20 MB of additional memory each to start working (but they will not use it completely), in case you have only 70 MB virtual memory all 5 applications can't work at once because they "need" 100MB. Those 30 MB extra will be "reserved" from nonexist pseudo swap.
I have attached swapinfo output from one of our systems, where there is enought phisical memory and there is no need of using the swap.
Regards,
Borislav
Don Morris_1
Honored Contributor
Solution

Re: reservation of pseudo-swap space

There are a couple corner cases that apparently the white paper authors didn't feel worthy of mention.

First - any kernel memory allocation that needs swap reservation gets it from Memory Swap first, and then device swap. [Paging of kernel structures is a last resort].

Second - locked memory (via mlockall() / plock() ) consumes memory swap first if no swap has already been reserved for it. Again - this is because the pages are supposed to be sitting there consuming RAM anyway, not using disk space (otherwise why is the user locking them?). If they're going to be consuming RAM and can't be paged -- that's pretty much the definition of Memory Swap.
Steve Steel
Honored Contributor

Re: reservation of pseudo-swap space

Hi


Look here for a good example.ftp url shown

Also some good non supported tools for memory management

Memory Usage - â What is using all of the memoryâ ?

by:eric.herberholz@hp.com

Last modified: July 14, 2004

Latest version available at external ftp site:

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





Table of Contents

Introduction
The memory line in the output of swapinfo
swapinfo defined


A. Review Buffer Cache size
B. Monitoring Memory Usage
1. plain memory (malloc) - ps, procsize, kmeminfo, and Glance
2. shared memory (shmget) - ipcs, shminfo and procsize

3. memory mapped (mmap)- shminfo and procsize
C. OS Memory Leaks/Hogs
1. Check for OS memory leaks with kmeminfo
2. Check for known memory hogs (e.g. JFS inode cache)

D. Application Memory Leaks



E. 32-bit memory limitation
F. SHMEM_MAGIC

G. How much data space can application get?

H. Memory Windows: details patches how to check for Memory Windows memwin_stats


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

J. Troubleshooting of â Not enough spaceâ and "Not enough core"




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