HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

When the use of swap ?

 
XIAODANWU
Occasional Advisor

When the use of swap ?

# kmeminfo
tool: kmeminfo 6.06
unix: /stand/vmunix 11.11 64bit PA2.0 on "CADB3245"
core: /dev/kmem live
link: Thu Nov 6 17:27:06 EAT 2008
boot: Sat Apr 18 11:24:48 2009
time: Thu Jul 2 17:47:38 2009
nbpg: 4096 bytes


----------------------------------------------------------------------
Physical memory usage summary (in page/byte/percent):

Physical memory = 2096640 8.0g 100%
Free memory = 178459 697.1m 9%
User processes = 1178151 4.5g 56% details with -user
System = 734942 2.8g 35%
Kernel = 420446 1.6g 20% kernel text and data
Dynamic Arenas = 221151 863.9m 11% details with -arena
M_TEMP = 150354 587.3m 7%
M_IOSYS = 17231 67.3m 1%
M_SPINLOCK = 10475 40.9m 0%
VFD_BT_NODE = 7415 29.0m 0%
ALLOCB_MBLK_LM = 6210 24.3m 0%
Other arenas = 29466 115.1m 1% details with -arena
Super page pool = 33095 129.3m 2% details with -kas
Static Tables = 139657 545.5m 7% details with -static
pfdat = 47442 185.3m 2%
nbuf = 32320 126.2m 2% bufcache headers
htbl2_0 = 16384 64.0m 1%
inode = 10171 39.7m 0%
pfn_to_virt = 7907 30.9m 0%
Other tables = 25432 99.3m 1% details with -static
Buffer cache = 314496 1.2g 15% details with -bufcache
UFC file mrg = 0 0.0b 0%
UFC meta mrg = 0 0.0b 0%
# top -f /tmp/top.out

# swapinfo -atm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 200 7992 2% 0 - 1 /dev/vg00/lvol2
reserve - 4795 -4795
memory 6182 6133 49 99%
total 14374 11128 3246 77% - 0 -
you can see Free memory is 697M but the swap is used 2% why???? When the use of swap ?
I know when the memory is below lotsfree then the swap is occur
the system memory is not below lotsfree,the swap is occur,why????
4 REPLIES
Roopesh Francis_1
Trusted Contributor

Re: When the use of swap ?

Hi,
Physical memory is a finite resource on a computer system. Only so many processes can fit in physical memory at any one time, though many more may actually be ready to run or execute. Swapping and paging algorithms allow processes or portions of processes to move between physical memory and a mass storage device. This frees up space in physical memory.

Swap space is an area on disk that temporarily holds a process memory image. When physical memory demand is sufficiently low, process memory images are brought back into physical memory from the swap area on disk. Having sufficient swap space enables the system to keep some physical memory free at all times.

Don Morris_1
Honored Contributor

Re: When the use of swap ?

Once pages are swapped out -- they are only swapped back in if faulted. They are released when the owning process(es) exit.

So most likely this is simply a matter of having memory pressure in the past -- and 200Mb of that pressure has not been referenced and can sit out on the swap device for now.
XIAODANWU
Occasional Advisor

Re: When the use of swap ?

thanks all replyï¼ ï¼ ï¼ ï¼ ï¼
spt#[/tmp]./kmeminfo
tool: kmeminfo 7.18 - libp4 9.295 - HP CONFIDENTIAL
unix: /stand/vmunix 11.11 64bit PA2.0 on host "tspt"
core: /dev/kmem live
link: Sat Feb 21 09:48:44 EAT 2009
boot: Sat Feb 21 09:53:27 2009
time: Tue Jul 7 09:19:39 2009
nbpg: 4096 bytes


----------------------------------------------------------------------
Physical memory usage summary (in page/byte/percent):

Physical memory = 523776 2.0g 100%
Free memory = 22472 87.8m 4%
User processes = 207187 809.3m 40% details with -user
System = 286568 1.1g 55%
Kernel = 129436 505.6m 25% kernel text and data
Dynamic Arenas = 55576 217.1m 11% details with -arena
M_TEMP = 37011 144.6m 7%
ALLOCB_MBLK_LM = 3819 14.9m 1%
M_SPINLOCK = 2788 10.9m 1%
M_SWAP = 2076 8.1m 0%
M_VXVM = 1367 5.3m 0%
Other arenas = 8515 33.3m 2% details with -arena
Super page pool = 26345 102.9m 5% details with -kas
Static Tables = 39839 155.6m 8% details with -static
nbuf = 14816 57.9m 3% bufcache headers
pfdat = 11895 46.5m 2%
htbl2_0 = 4096 16.0m 1%
text = 2643 10.3m 1% vmunix text section
pfn_to_virt = 1982 7.7m 0%
Other tables = 4406 17.2m 1% details with -static
Buffer cache = 157132 613.8m 30% details with -bufcache
UFC meta mrg = 0 0.0 0%
UFC file mrg = 0 0.0 0%

tspt#[/tmp]swapinfo -atm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
reserve - 1335 -1335
memory 1532 917 615 60%
total 5628 2252 3376 40% - 0 -
look,this is another system,free memory is 87.8m ,but do not occur swap? why???
Don Morris_1
Honored Contributor

Re: When the use of swap ?

Again -- it is all a matter of _when_ you look.

Both systems start with no swap consumed on boot. Processes run.

System A enters memory pressure, swap begins to be used. Some time later, the pressure eases -- some swap remains used because it is unreferenced, and you look at swapinfo and see this.

System B never entered sufficient memory pressure to swap (or did so, and all said pages were brought back in after the pressure eased... swapinfo doesn't tell you which) -- hence you see no swap used. If it enters memory pressure in the future and swaps pages out, you'll see that.