1833750 Members
2456 Online
110063 Solutions
New Discussion

About swap memory

 
SOLVED
Go to solution
Cheung_2
Frequent Advisor

About swap memory

How can I know the usage status of swap memory ? How can I increase it? thx.
Andy
6 REPLIES 6
KapilRaj
Honored Contributor

Re: About swap memory

swapinfo is the command
You can increase it by swapon command . See the man pages for it

kaps
Nothing is impossible
RAC_1
Honored Contributor

Re: About swap memory

swapinfo is the command you are looking for.

check man pages.
There is no substitute to HARDWORK
Rajeev  Shukla
Honored Contributor

Re: About swap memory

Yes you can see the usage of swap memory by swapinfo -tm which tells you in MB. And to increase the device swap create a logical volume and if you are new to HPUX and want to be more safe use sam to create the swap. Or add an entry in /etc/fstab and use swapon -a to activate the swap.

Rajeev
Jaffar
Advisor
Solution

Re: About swap memory

U need to first confirm for which type of swap u need.

well the above persons verdict r correct.
1.swapinfo ----->to see the information of swap currently configured

2.Go for file swap ie select a filesystem free ...and with swapon command use the file as swap.


Born to learn
Rita C Workman
Honored Contributor

Re: About swap memory

All of the above have answered correctly.
But let me simply add a few thoughts here..

You are correct in wanting to know what is the utilization of swap memory...remember when you read the swapinfo -tam or swapinfo -tm command your bottom line is total/average of ALL your defined swap (i.e. physical memory and device swap) Take a look at the lines that reflect device or filesys swap - if they show 0 utilization than you are doing well, for you have never had to swap (or page) to physical devices. And trying to maintain ALL your paging/swapping in memory is what will give you the best performance.
So let me recommend that before you add more disk swap space...you consider doing a couple other things, that I have learned seem to give the most return for the time invested.

First, check your parms - make certain that they are tuned properly. A poorly set kernel can be a detriment to system performance. Search/look through threads here for more info on kernel tuning !

Second, observe your applications performance. I have gotten some of my biggest performance improvements by simply getting after the programmers to clean up their syntax. Amazing how a few lines of bad code...can choke a box. And all I used was Glance to see what was chewing up resources !

When steps 1 & 2 have been taken as far as I can take them...then I look at adding something as far as hardware. I look first at adding physical memory, since these days that is not a big cost. And physical memory will give you the best return for your investment. The last option I take is to add disk swap. And I only do this as a last ditch effort to keep running - because if I'm at this point...than the fact is that the 'system' has outgrown the box...and so I (and any UNIX Admin worth their salt) would have already put in for a bigger server.

Hope this helps,
Rita

T. M. Louah
Esteemed Contributor

Re: About swap memory

To add to above:
# swapinfo -tma will give you the total %used which is a good indication on how short you are in swap space (60-70% should be alarming) a confusing line in the output is the Memory line which is related to pseudo-swap & not to RAM. Pseudo-swap can be disabled/enabled by setting kernel parm swapmem_on to 0/1. If you don't see it in swapinfo output that means it is disabled, it recommended to enable it.
Top will also show you the Memory (real & virtual) usage on your system the last nbr is for Free memory that another way, if it is low, to determine if you are short in swap space.
A system short in swap space will logg msg in syslog or stdout/stderr about "out of memory" & applications will return some indication too. For example a failure with errno 12 in syslog as indicated in /usr/include/sys/errno.h:
#define ENOMEM 12 /* Not enough core */ This means not enough Virtual memory. More about swap can be found in process mangement white paper in docs.hp.com or check in /usr/share/doc dir on ur system.

Cheers,
T??
Little learning is dangerous!