Virtual Memory Usage a Process

Hi all,

Is there any command which shows the virtual memory usage of a particular process in HP-UX machine.

I have tried with ps, top but could not get what I want.

Kindly provide me a solution.

Thanks in Advance
ARD

On any POSIX compliant Unix, this should just work:

ps -o vsz -p pid

But ... in HP-UX you need to invoke the Berkeley unix ps command with this somewhat unusual syntax:

UNIX95= ps -o vsz -pxxxxx
Where xxxxx is the process ID.

The space character after the equals sign is mandatory. The space character after -p is not mandatory.

The portable way to get a POSIX environment is to run:

PATH=$(getconf PATH)
ps -o vsz -p xxxxx

This should work on HP-UX too.

Sorry, but it does not work in HP-UX.
All it does is change the value of $PATH to:

/usr/bin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/fortran/bin

Never used it myself, but this looks more like an ANSI variation than a Posix variation.
It still finds /usr/bin/ps , but does not present the program with the "UNIX95" environment to invoke the Berkeley syntax.
In Solaris there are multiple utilities with the same or similar name but which behave differently (awk/nawk; sed/sed; ps/ps; .. etc). I actually prefer this design over the multi-purpose single program.

I would really love one parameter which made all unix boxes behave the same.
C'est la vie.