Operating System - HP-UX
1829595 Members
2064 Online
109992 Solutions
New Discussion

memory leakage in application

 
SOLVED
Go to solution
nitren
Frequent Advisor

memory leakage in application

Hi !
On a rp5430 running HPUX11.00 we have an application flooding syslog with the following msgs:"Sep 1 11:34:48 hippo SPOServer[18242]: clnt_dg_create: out of memory
Sep 1 11:46:16 hippo SPOServer[18242]: xdr_bytes: out of memory". The server itself doesn't have problem with memory. Here's output from ipcs -moba:#
IPC status from /dev/kmem as of Thu Sep 2 10:40:25 2004
T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME
Shared Memory:
m 0 0x411c0231 --rw-rw-rw- root root root root 0 348 462 462 20:45:31 20:45:31 20:45:24
m 1 0x4e0c0002 --rw-rw-rw- root root root root 1 31040 462 462 20:45:27 20:45:31 20:45:24
m 2 0x41200ab5 --rw-rw-rw- root root root root 1 8192 462 474 20:45:27 20:45:24 20:45:24
m 10803 0x78840edb --rw-rw-rw- pro staffwar pro staffwar 26 6968 18137 18166 20:15:47 no-entry 20:15:45
m 404 0x788453f8 --rw-rw-rw- swuser staffwar swuser staffwar 26 4722360 13121 18166 20:15:47 no-entry 22:18:16
What does this output imply?

Rgds
NilsI



8 REPLIES 8
RAC_1
Honored Contributor

Re: memory leakage in application

One way to check if application has memory problems is check the memory it is using. Check the the memory it is using every 5-10 mins. If it is contineously grwoing, we can say that it has memory leak.

UNIX95= ps -C "program_name" -o "vsz, ruser, pid"

Run it every 5-10 mins and check how the memory is used.

There are also some products like purify to check the memory leaks.

How much swap space you have??? How much is used and what is the memory utilization??

Anil
There is no substitute to HARDWORK
ranganath ramachandra
Esteemed Contributor

Re: memory leakage in application

'out of memory' need not necessarily indicate a memory leak.

hp gdb can be used to detect memory leaks. links are under http://www.hp.com/go/wdb .
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

nitren
Frequent Advisor

Re: memory leakage in application

Hi !
# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 76 4020 2% 0 - 1 /dev/vg00/lvol2
reserve - 830 -830
memory 1526 867 659 57%
total 5622 1773 3849 32% - 0 -
UNIX95= ps -eopid,vsz,user,args |sort -rnk2|pg
21863 495836 pro /usr/staff/bin/swentobjsv
1423 20332 root /usr/ecc/exec/MHR510/mhragent
18141 18632 swuser /usr/staff/etc/wisrpc 1073759963 0 18139
18154 16712 swuser /usr/staff/etc/wisrpc 1073759963 13 18139
18155 14024 swuser /usr/staff/etc/wisrpc 1073759963 14 18139
18139 12472 swuser /usr/staff/etc/wqsrpc 391875 18138
Sridhar Bhaskarla
Honored Contributor
Solution

Re: memory leakage in application

Hi,

As you are already aware, 'out of memory' errors won't get generated if the system runs out of physical memory as HP-UX uses virtual memory.

This could be a result of shot of swap space, insufficient kernel limits for anyof the *siz (_64bit if it is a 64 bit program), kernel tables such as nfile etc., Check with your application vendor on their recommendations for the kernel parameters. You are looking good on swap usage. Running short of physical memory may slow down your system but shouldn't give those errors. To find out memory leaks, run

UNIX95= ps -e -o 'vsz pid ruser args' at periodic intervals and find the processes whose vsz is gradually increasing over the time.


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor

Re: memory leakage in application

xdr_bytes() is a function in the External Data Representation (XDR) library. It is used to handle data in a platform independent way. The typical way to use this function is to pass in a NULL pointer for a buffer (actually a pointer to a pointer to a NULL) and in that case the memory is dynamically allocated on each call. The programmer is expected to free this memory when no longer needed. You are probably hitting the maxdsiz limit (especially if this is a 32-bit application). Increasing maxdsiz will certainly delay your problems but if the problem is a memory leak the real answer is to fix the program -- or the programmer.

If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: memory leakage in application

Out of memory in most cases has to do with internal limits that are set too low. The program is probably a simple 32bit program and is constrained by the kernel parameter maxdsiz. Use SAM to change this value from the default 64megs to 1700 megs, This should fix the problem. If not, call the mfr or programmer to have them read the mem_mgt and proc_mgt docs in /usr/share/doc. There are several steps that can be taken to increase the memory available to 32bit programs.


Bill Hassell, sysadmin
nitren
Frequent Advisor

Re: memory leakage in application

Hi !

I've changed the value of maxdsiz to 2Gb in June.
Bill Hassell
Honored Contributor

Re: memory leakage in application

Check the above docs for the term EXEC_MAGIC. If the program uses shared memory, the problem may be with shared memory mapping--look for SHARE_MAGIC in the same docs. The executable may need to recompiled or use the chatr command to change the executable. If the "out of memory" message refers to shared memory (no way to tell--the programmer was not nice enough to report that) then get a copy of shminfo from:

ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/shminfo/

Since shared memory uses a common map for all programs that need it, the map may be exhausted or fragmented. You'll need to look at memory windows as a workaround for shared memory fragmentation. You'll need the latest patches to implement memory windows.


Bill Hassell, sysadmin