1820638 Members
1915 Online
109626 Solutions
New Discussion юеВ

SWAP 100% FULL

 
SOLVED
Go to solution
Ritter Philippe
Advisor

SWAP 100% FULL

Hello,
I need help because my SWAP Space is now full, and I don't which process make this. This system is up since many months without any problem. Now, when i make swapinfo -ta,, I get this :
savigny:~# swapinfo -tam
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 - 4075 -4075
memory 6238 6238 0 100%
total 10334 10313 21 100% - 0 -

How can I handle this problem. The system has 8Gb memory and run Sybase Datasever. Sybase has only 6 Gb allocated.

Thanks for any Help !
Regards
Philippe RITTER
12 REPLIES 12
Keith Bryson
Honored Contributor

Re: SWAP 100% FULL

Hi there

Your swap space should be at least 1xRAM (therefore 8Gb), so you will need to add another swap logical volume (using lvcreate) and then use swapon to add the new swap to the system. Modifications need to be made to the /etc/fstab too. If you need further clarification, let us know.

Keith
Arse-cover at all costs
Keith Bryson
Honored Contributor

Re: SWAP 100% FULL

Hi again

If you are not too familiar with HP-UX, you can use sam to add swap (sam will inform you if the kernel needs modification, will modify the /etc/fstab file for you and enable swap):

- Run sam and select menu options:
Disks and Filesystems -> Logical Volumes -> Actions ->> Create

- Add an 'LV Name' for swap
- Specify the 'LV Size'
- Alter the 'Usage' field to 'Swap Device'
- Ensure the 'Enable Swap' option says 'Now and At Boot'.

Hopefully you have some disk space!!

Hope that helps - Keith
Arse-cover at all costs
Ritter Philippe
Advisor

Re: SWAP 100% FULL

Thank you for your help. I know I can had swap to my system, but what I want to know is WHY my system is using so much SWAP. The system was running fine for some months with 4Gb ! I rebooted the server and now i have only 61 % used. I will check today if this goes up, and then had swap or not. Does it exist a tool to see wich process use swap ? Or for what the swap is used ?

Thanks
Keith Bryson
Honored Contributor

Re: SWAP 100% FULL

Hi there

Be aware that the system will 'reserve' swap as it uses RAM. The potential is that if you are using 6Gb RAM, 6Gb of swap will be reserved. That is why you should really be running at least 1xRAM for swap. For your system I would recommend that you go 2xRAM.

Keith
Arse-cover at all costs
Mark Nieuwboer
Esteemed Contributor

Re: SWAP 100% FULL

Hi,

Did you try to use glance to get the proces wich make the swap full

grtz Mark
Ritter Philippe
Advisor

Re: SWAP 100% FULL

Ok, I will try to add 4Gb more to the SWAP. I don't know how to use glance to find the process using the max swap. Can you help me please ?

thanks
Philippe RITTER
Keith Bryson
Honored Contributor

Re: SWAP 100% FULL

Hi

Somethings you may want to check:

If you have glance, hit 'm' and this will detail memory usage. You may be using a lot of RAM if your buffer cache is set too high. This should really be 200-800Mb, but may be smaller.

Keith
Arse-cover at all costs
bhavin asokan
Honored Contributor

Re: SWAP 100% FULL

hi,

how you says swap is full

from your swapinfo

type =dev
available =4096MB
used = 0MB
free =4096MB
used % =0%

(on my systems it is showing minimum 10%)
check on your kernel for swapmem_on is 0 or 1.

if it is 0 ,change it to 1 and rebulit the kernel.

also post the vaules showing against the dbc_min_pct & dbc_max_pct variables when you are using sysdef command.

regds,
Mark Nieuwboer
Esteemed Contributor

Re: SWAP 100% FULL

Hi Phillippe,

With glance -m you see how much memery is used.
With gpm you can see the history of the memory use.

I can make the swap space bigger but it doen't change the problem.

grtz. Mark
B. Hulst
Trusted Contributor

Re: SWAP 100% FULL

Hi,

If the system is running full over time here is a memory leak in one of your applications.

Quite often it is in a self made application, since Off the shelf applications should be tested against memory leaks. ;-)

These tools can be used to measure the amount of swapping in your system.
iostat (for the swap volume)
vmstat (for swap stats)

man iostat or man vmstat give you the options.

Regards,
Bob
Ritter Philippe
Advisor

Re: SWAP 100% FULL

Ok, here is my sysdef :
NAME VALUE BOOT MIN-MAX UNITS FLAGS
acctresume 4 - -100-100 -
acctsuspend 2 - -100-100 -
allocate_fs_swapmap 0 - - -
bufpages 131072 - 0- Pages -
create_fastlinks 0 - - -
dbc_max_pct 50 - - -
dbc_min_pct 5 - - -
default_disk_ir 0 - - -
dskless_node 0 - 0-1 -
eisa_io_estimate 768 - - -
eqmemsize 46 - - -
file_pad 10 - 0- -
fs_async 0 - 0-1 -
hpux_aes_override 0 - - -
maxdsiz 65536 - 0-503866 Pages -
maxdsiz_64bit 262144 - 1024-1073479679 Pages -
maxfiles 2048 - 30-2048 -
maxfiles_lim 2048 - 30-2048 -
maxssiz 2048 - 0-98048 Pages -
maxssiz_64bit 2048 - 4-262144 Pages -
maxswapchunks 8192 - 1-16384 -
maxtsiz 16384 - 0-503859 Pages -
maxtsiz_64bit 262144 - 1024-1073741823 Pages -
maxuprc 256 - 3- -
maxvgs 10 - - -
msgmap 39 - 3- -
nbuf 68646 - 0- -
ncallout 2064 - 6- -
ncdnode 150 - - -
ndilbuffers 30 - 1- -
netisr_priority -1 - -1-127 -
netmemmax 0 - - -
nfile 2302 - 14- -
nflocks 512 - 2- -
ninode 1340 - 14- -
no_lvm_disks 0 - - -
nproc 1044 - 10- -
npty 60 - 1- -
nstrpty 60 - - -
nswapdev 10 - 1-25 -
nswapfs 10 - 1-25 -
public_shlibs 1 - - -
remote_nfs_swap 0 - - -
rtsched_numpri 32 - - -
sema 0 - 0-1 -
semmap 63 - 4- -
shmem 0 - 0-1 -
shmmni 200 - 3-1024 -
streampipes 0 - 0- -
swapmem_on 1 - - -
swchunk 2048 - 2048-16384 kBytes -
timeslice 10 - -1-2147483648 Ticks -
unlockable_mem 32768 - 0- Pages -
bhavin asokan
Honored Contributor
Solution

Re: SWAP 100% FULL

hi,

see on the line.
dbc_max_pct 50 - - -

dbc_max_pct 50 means it can take up to 50% of your physical memory for buffer cache.for your system(8GB) it can be up to 4GB which is a waste.

memory of 600-800MB willbe much enough for buffer cache.

reduce the value of dbc_max_pct parameter in kernel to a value of 10 . it will free a lot of space in your system.

note: it is a ststic parameter.you must have to rebuild the kernel for changing it.use sam.it is safe.

regds,