1846870 Members
3283 Online
110256 Solutions
New Discussion

Re: Process: swap usage

 
SOLVED
Go to solution
j773303
Super Advisor

Process: swap usage

Is it possible to know which process or daemon the swap space? Since, I meet the problem "fork fail: no swap space". There're many process running on the system. Which way could know the swap space allocated to which process?
Hero
11 REPLIES 11
Karthik S S
Honored Contributor

Re: Process: swap usage

Hi,

man vmstat
man top

Also refer to the links in the following thread for more info,

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc5c0506d69a7d711abdc0090277a778c,00.html

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Con O'Kelly
Honored Contributor

Re: Process: swap usage

My advice would be to increase swap space or enable pseudo_swap (Kernel parameter swapmem_on) if it is not already enabled.

How much memory and swap is configured on your system??

Cheers
Con
j773303
Super Advisor

Re: Process: swap usage

The swap space has 4GB.
I gutess the application problem. But I'd prove
it. So, I want to know the swap usage.Thanx.
Hero
Con O'Kelly
Honored Contributor

Re: Process: swap usage

Hi

#swapinfo -tam
This will show you swap usage.
But your problem is more liklely to be a result of not enough swap configured.

How much memory do you have on the system? At the absolute minimum you need at least as much swap as Physical memory (if you don't have pseudo swap enabled). Normally it is advisable to configure 1.5-2 x swap as physical memory.

Post output of:
# kmtune -q swapmem_on
# swapinfo -tam.


Cheers
Con
Dietmar Konermann
Honored Contributor

Re: Process: swap usage

You should have a look with at processes with huge virtual set size (VSZ):

# UNIX95=1 ps -eo vsz,pid,comm | sort -nr

Please note that sometimes (especially for "lazy swap" allocations) VSZ can be far too high (a good example is Java). On Itanium systems the text segment is also allocated "lazy", causing some maxssiz offset. However, it's a good first shot in most situations.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Zeev Schultz
Honored Contributor

Re: Process: swap usage

I'd bet on "reserve" in swapinfo output being
to close to "dev" which means no new forks will
work,as reserve goes to swap kept for new forks.Which brings us to a strange conclusion
that you don't have enough swap (although 4gb souns nice).
Otherwise its a leak and you can use either ps
or Glance.
So computers don't think yet. At least not chess computers. - Seymour Cray
doug mielke
Respected Contributor

Re: Process: swap usage

I agree with the swapmem_on. I had a similar problem, fork failed, but no swap activity, with mountains of swap space.
The swapmem parameter has the effect of disableing the HPUX feature of reserving swap memory when a process starts. If you have enough memory to prevent swapping, you're pretty safe not reserving it.
j773303
Super Advisor

Re: Process: swap usage

The glance will show how many TEXT,DATA,STACK RSS/VSS are used for per process. But how to know the swap usage per process? Any other command or tools can support this?
Hero
Con O'Kelly
Honored Contributor

Re: Process: swap usage

Hi
All processes when they start will reserve swap space. The amount they reserve is determined by the processes memory size. They reserve enough swap space so that if necessary the process can be swapped out.

Again I would reiterate that you need to be sure that you have enough swap configured. 4GB of swap is only just enough if you only have 4GB of memory. If you have more than 4GB of memory and pseudo_swap is not enabled then you definitely need more swap or to enable pseudo_swap.

If you are still having problems with the fork, then let us know how much RAM you have and also the output of swapinfo -tm and kmtune -q swapmem_on.

Cheers
Con

j773303
Super Advisor

Re: Process: swap usage

The Physical memory is 2GB, and SWAP is 4 GB.
I also want to know how to show the swap space for per process? A perocess will reserved how many swap space. Any tool can show this? Thankx.
Hero
Con O'Kelly
Honored Contributor
Solution

Re: Process: swap usage

Hi

Your swap configuration looks OK.
Do you have pseudo swap enabled?

I'm not aware of any command that shows a processes swap reservation. My understanding is that its determined by the processes memory size. For examle if a process has size of 500MB then it will need to reserve at least this much swap space when it starts.

Are you having problems starting alot of processes or is it a particular process that gives the fork error??

Have a read of the HP document on swap.
http://www1.itrc.hp.com/service/cki/search.do?category=c0&mode=id&searchString=KBRC00001262&searchCrit=allwords&docType=Security&docType=Patch&docType=EngineerNotes&docType=BugReports&docType=Hardware&docType=ReferenceMaterials&docType=ThirdParty&search.x=33&search.y=6

If you can provide a bit more detail on the error and when it occurs someone may be able to help.

Cheers
Con