Per process swap space utilization in HP-UX

Posted on 2011-04-20
Last Modified: 2012-05-11
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
Question by:sunhux
    LVL 10

    Assisted Solution

    vsz is size of the data section of the virtual memory of a process.

    This may help you out:


    Author Comment


    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?
    LVL 38

    Accepted Solution

    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.

    LVL 20

    Assisted Solution


    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

    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

    Author Comment


    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?
    LVL 20

    Assisted Solution

    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

    Author Closing Comment

    ok thanks

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
    Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now