Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3021
  • Last Modified:

Per process swap space utilization in HP-UX

I've  been getting high swap space utilization alerts every couple of hours
on my Oracle DB server.

I put the above 2 liner script in crontab to run every minute
& then compare the outputs between the swap utilization is
normal (ie this is the baseline) vs when it's high.

date >> /tmp/swap_$(date +%Y%m%d_%H%M)
UNIX95= ps -e -o "user,vsz,pid,args" | sort -rnk2 >>/tmp/swap_$(date +%Y%m%d_%H%M)

is vsz in the script above a good measure/indicator of each process'
swap / memory utilization?

What other HP-Ux commands or methods I can use to facilitate which
is the culprit process?

I'm on HP-Ux B11.11
4 Solutions
dfkeSr. Systems EngineerCommented:
vsz is size of the data section of the virtual memory of a process.

This may help you out: http://administratosphere.wordpress.com/2009/01/31/how-much-can-you-find-out-about-a-hp-ux-process/

sunhuxAuthor Commented:

Thanks but there's not quite directly replying to my question

What other HP-Ux commands or methods I can use to facilitate tracking down which
is the culprit process?

If vsz is not the best parameter to look at for the "UNIX95=....." command, what
other parameter can I use?
A1. No or yes.
Swapping is system behavior. When system run out of memory, then system will swap the memory into disk (or call paging).
Process pre-request certain amount of memory as VSZ. This value will change (usually increase)
from time to time.
When one of process's vsz value greater than system memory size, then system most likely start swapping.

A2. vmstat + ps
First, you need to detect swapping of system. Using "vmstat 5 2"
     procs           memory                   page                               faults       cpu
r     b     w      avm    free   re   at    pi   po    fr   de    sr      in     sy    cs  us sy id
0     0     0     1158     456    0    0     0    0     0    0     0     111     18     7   0  0 100
0     0     0     1221     436    5    0     5    0     0    0     0     108     65    18   0  1 99
Look at "pi po" value at the bottom line (column 8, 9).
pi is 5, means the system start to page in memory from disk.
(I usually care about po, amount of memory swapped to disk).

PO=`vmstat 5 2| tail -1| awk '{print $9}'`
if [ $PO -gt 10 ]  
   ps -e -o "user,vsz,pid,args" | sort -rnk2 >>/tmp/swap_$(date +%Y%m%d_%H%M)

At this point, all the large vsz processes contribute the system swapping.

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


A0: VSZ _and_ the equivalent amount of swap space are reserved when a program starts. "swapinfo -tm" will show you if swap-space reservations are getting close to the amount of swap space available. This doesn't necessarily mean swapping is occurring yet.

A1: vsz is a useful measure for processes that don't use shared memory

A2: http://www.chapelhill.homeip.net/horton/copies/MemoryUsage-HPUX.htm
The above link gives you info on
- other tools
- how to evaluate real memory usage of shared-memory processes
- Checking swap space usage and if swapping (paging) is occurring (+ an intro to pseudo-swap)
- Tracking down memory leaks
sunhuxAuthor Commented:

I tried to login using the login id Anonymous to the link below but it won't allow login:

How do I get into hprc?
I thought I posted a reply to this, but it hasn't appeared?!

The links in that document don't work any more, but you don't need to get into the HPRC server to read the full article - Just scroll down.

To get the additional tools (e.g. kmeminfo) you will need to log a support call
sunhuxAuthor Commented:
ok thanks

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now