memory leaks

Hi!! Experts,

Any ideas how to check for the memory leaks in a process during performance testing?? I dont use purify.. Any way of finding it out using default S/W in HP UX-11

Can U gimme pointers to site having good scripts/tutorials on performance testing??

Thanx in Advance..

:slight_smile:

ps -elf will show you the memory usage of processes on your system. You can run ps -elf every so often and compare the size of the processes between runs. If you see one getting larger, it is using more memory. If it continues to use more and more memory or stops doing any actual work and does not free up memory, you may have a leak. I say 'may' because some code will keep the pool of memory allocated to it and use it when it starts processing again.

On HP-UX the sz field of ps is the resident set size. Since HP-UX supports demand loading, an increase in the rss may just mean that more of the process has page faulted into core. Depending on what definition of "memory leak" we are using, you may be able to detect leaks by looking at the virtual set size. On HP-UX you can do this with:
UNIX95=1
export UNIX95
ps -o pid,comm,sz,vsz -e
Or if you're using a real shell, just:
UNIX95=1 ps -o pid,comm,sz,vsz -e

HP has a product called glance which is a much better tool for stuff like this. It can show you the RSS/VSS of each memory region of a process.

You can use the "top" command to minitor the processes that is running on your system

While are running the testing program. You can have another terminal that run the "top" program.

The "top" program will automatically refresh after about couple of seconds. You can see the % of CPU usage and the % of memory usage of the process.

This is my best guess. Hope it helps