1833178 Members
2689 Online
110051 Solutions
New Discussion

Swapping!!

 
Sandip Ghosh
Honored Contributor

Swapping!!

OS HP-UX 10.20
Server K460
Phy Mem 1.75 GB
Swap 1 Gb & 500 MB

In the Glance display I could see the Memory Utilisation as 90%, but when I am looking for Swapinfo it is showing that it is swapping on the device.

swapinfo -tm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 512 0 512 0% 0 - 1 /dev/vg00/lvol2
dev 1024 18 1006 2% 0 - 0 /dev/vg01/lvol9
reserve - 1246 -1246
memory 1330 397 933 30%
total 2866 1661 1205 58% - 0 -

I am not sure how it will come on the display.

Total VM : 680.3mb Sys Mem : 161.0mb User Mem: 1.15gb Phys Mem: 1.75gb
Active VM: 160.5mb Buf Cache: 268.8mb Free Mem: 183.1mb

Now my question is if it is showing memory as free how it is swapping on the device.

Any look out is highly appreciated.

Sandip
Good Luck!!!
12 REPLIES 12
Patrick Wallek
Honored Contributor

Re: Swapping!!

At this point, with just 2% used, I don't know that I 'd worry too much. You may have just ahd a process that needed a bit more memory than was available. But I don't think 2% is too bad at this point.

If it continues to grow, then I'd start checking.

Rita C Workman
Honored Contributor

Re: Swapping!!

Well your question is simply why it swapped to disk...

Because at some point the processing exceeded what could be run in memory and it had to page out to disk....then the processing slowed down and you continued to run your jobs within memory.

Overall you average use of memory is 58%, where you seem to have hit disk at 2% of time.
Monitor what's going on..vmstat is good for watching when it's paging out. Then see if you can tweek your kernel to improve things or do you need to add some more memory.

Just my thoughts,
Rita
Sandip Ghosh
Honored Contributor

Re: Swapping!!

Hi Patrick,

Thanks for your reply. I am not too worried for this, but curious about why it is happening like that.

Sandip
Good Luck!!!
Rita C Workman
Honored Contributor

Re: Swapping!!

....I agree w/Patrick. 2% is not much of something to worry about. Probably just a little more going on at that time than usual..

No points here,
Rita
Shannon Petry
Honored Contributor

Re: Swapping!!

Hard to tell excatly what you want to hear, but I'll try. (pretty basic example)

Q: Why is swap being used when memory is available?
A: Active applications may have enough memory occupied where the memory manager needs to keep space free.
I.E. application1 allocates .5Gb RAM. application2 allocates 256M, application3 allocates 400M. This should leave space within 1.7Gb to not swap anything. However, application2 allocates another 256M, performs it's task, then releases it. The memory manager has exceeded memory, and expects this may happen again. application3(our make believe inactive application) now gets pages put to device swap, and will stay there until the memory manager thinks it's safe to use real memory again.

HP will have to let you know the algorythm's they use, but memory management is very intelligent.
Microsoft. When do you want a virus today?
Sandip Ghosh
Honored Contributor

Re: Swapping!!

Thanks Rita. I could find that this 2% is a continuous thing. Whenever you do a swapinfo it gives this 2% utilisation.

Sandip
Good Luck!!!
Patrick Wallek
Honored Contributor

Re: Swapping!!

One thing to check that I didn't think of earlier is how your buffer cache is set up. What are dbc_min_pct and dbc_max_pct set to? If dbc_max_pct is still at the default of 50% then you can probably reduce that and free up a bunch of memory. With 1.75GB RAM, I'd probably reduce it to something like 20% (350MB) and see how that works for you.
Sandip Ghosh
Honored Contributor

Re: Swapping!!

Patrick, dbc_max_pct has been set to 15%. It is showing in the Buf cache of the Glance display as 268 MB.

Sandip
Good Luck!!!
Hai Nguyen_1
Honored Contributor

Re: Swapping!!

Sandip,

A process may not be swapped out but for every single process spawn, the OS needs to reserve as much swap space for the process as RAM required to run it. Your glance indicates that your "User Mem" is 1.15gb and your swapinfo indicates that your "reserve" is 1246Mb. They are pretty much the same.

Hope this helps.

Hai
Bill Hassell
Honored Contributor

Re: Swapping!!

One other use of swap space is for memory mapped files. Some applications will use this feature and these files will use some swap space, but with little effect on the system.


Bill Hassell, sysadmin
Sandip Ghosh
Honored Contributor

Re: Swapping!!

Can it be possible if we increase the SGA size of Oracle? We have increased the size of the SGA recently.

Sandip
Good Luck!!!
Sajid_1
Honored Contributor

Re: Swapping!!

Hi,

I don't think increase in the SGA will swap out. You can defenitely check for any new patches and may need to install that. Another option is to oberve the swap usage from Glance and see which process is doing this or the Kernel mapping ?

rgds,
learn unix ..