Author |
Message
|
frederic |
Posted: Fri Jan 27, 2006 4:19 am Post subject: Memory leak |
|
|
Newbie
Joined: 27 Jan 2006 Posts: 6 Location: AtosOrigin
|
Hi !
I use the XMS library to connect a Mq series file. Is works find, but i have a memory leak at each send (8k)
if someone can help me.
I don't now if is a mqm (5.3.11) leak or xms library (leak)
my code :
http://frederic.cheftel.free.fr/send.html |
|
Back to top |
|
 |
mvic |
Posted: Fri Jan 27, 2006 7:00 am Post subject: Re: Memory leak |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
frederic wrote: |
I don't now if is a mqm (5.3.11) leak or xms library |
I guess I need to ask the obvious, just so we are sure what's going on.
1. How are you sure the memory is leaking? 2. what version of XMS are you using (when/where did you download it?) 3. what OS platform are you on?
Is the program using server or client bindings? |
|
Back to top |
|
 |
frederic |
Posted: Fri Jan 27, 2006 7:14 am Post subject: |
|
|
Newbie
Joined: 27 Jan 2006 Posts: 6 Location: AtosOrigin
|
yes I'm sure . I have send message every minute last night and i have see memory used by application.
When I comment my function i don't have memory leak.
I have download XMS last week
Platform Solaris 8
first line of my log file :
---------------------------------------------
mqm 7360K 0.01% wnpinterginger
mqm 7752K 0.03% wnpinterginger
mqm 7768K 0.00% wnpinterginger
mqm 7776K 0.00% wnpinterginger
mqm 7784K 0.02% wnpinterginger
mqm 7792K 0.02% wnpinterginger
mqm 7792K 0.00% wnpinterginger
mqm 7800K 0.00% wnpinterginger
mqm 7808K 0.00% wnpinterginger
mqm 7816K 0.00% wnpinterginger
mqm 7816K 0.00% wnpinterginger
mqm 7824K 0.00% wnpinterginger
mqm 7832K 0.00% wnpinterginger
mqm 7840K 0.02% wnpinterginger
mqm 7848K 0.02% wnpinterginger
mqm 7848K 0.00% wnpinterginger
mqm 7856K 0.00% wnpinterginger
mqm 7864K 0.00% wnpinterginger
. . . .
. . . .
. . . .
mqm 13M 0.00% wnpinterginger |
|
Back to top |
|
 |
frederic |
Posted: Fri Jan 27, 2006 7:42 am Post subject: forget |
|
|
Newbie
Joined: 27 Jan 2006 Posts: 6 Location: AtosOrigin
|
|
Back to top |
|
 |
mvic |
Posted: Fri Jan 27, 2006 7:54 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
frederic wrote: |
When I comment my function i don't have memory leak. |
Sorry we should be as clear as possible here. What exactly do you comment out?
Does the rest of the program free all its allocated memory? |
|
Back to top |
|
 |
frederic |
Posted: Fri Jan 27, 2006 8:03 am Post subject: |
|
|
Newbie
Joined: 27 Jan 2006 Posts: 6 Location: AtosOrigin
|
|
Back to top |
|
 |
briancop |
Posted: Fri Jan 27, 2006 8:31 am Post subject: Looks like a leak in sendMessage |
|
|
 Apprentice
Joined: 04 Apr 2005 Posts: 28 Location: Hursley, UK
|
sendMessage has a leak (assuming you have DEBUG_GINGER set to 1 so that you interrogate the sent message).
After sending the message, your application looks at the contents of the message you have sent, including calling xmsMsgGetJMSDestination and xmsMsgGetJMSReplyTo.
These functions will return either null or a copy of the xmsDestination object used by the message. Because they return a copy, the application needs to call xmsDestDispose to release the copied memory.
There is a fair chance that xmsMsgGetJMSReplyTo will be returning null, but xmsMsgGetJMSDestination almost certainly will not, so I think that could be the leak you noticed (certainly at least part of it).
Unfortunately, looking at your code, it looks very familiar and I believe the XMS SampleProducerC and SampleConsumerC sample code have the same problem, which you have copied, so those samples need fixing to prevent other people falling into the same trap. I'll raise that with the XMS development team.
In the meantime, if you add a call to xmsDestDispose for the dest and replyTo variables (checking first to only call it if they are not null), that might solve your problem.
Brian |
|
Back to top |
|
 |
frederic |
Posted: Fri Jan 27, 2006 8:49 am Post subject: |
|
|
Newbie
Joined: 27 Jan 2006 Posts: 6 Location: AtosOrigin
|
When GINGER_DEBUG=0 I have the same behaviour
see :
mqm 7152K 0.13% wnpinterginger
mqm 7600K 0.13% wnpinterginger
mqm 7616K 0.12% wnpinterginger
mqm 7624K 0.11% wnpinterginger
mqm 7632K 0.11% wnpinterginger
mqm 7632K 0.10% wnpinterginger
mqm 7640K 0.09% wnpinterginger
mqm 7648K 0.11% wnpinterginger
mqm 7656K 0.10% wnpinterginger
mqm 7656K 0.12% wnpinterginger |
|
Back to top |
|
 |
frederic |
Posted: Fri Jan 27, 2006 9:12 am Post subject: |
|
|
Newbie
Joined: 27 Jan 2006 Posts: 6 Location: AtosOrigin
|
But I agree, a part of my memory leak can be provide of xmsDestDispose ... |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 27, 2006 1:26 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Guys,
Check out the fixes for this problem. I believe there is an APAR out there for this.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|