Re: Memory Leak while creating connection in MQ C API

  • From: Amy Kang <amy.kang@...>
  • To: prabha.lakshmi@...
  • Cc: issues@...
  • Subject: Re: Memory Leak while creating connection in MQ C API
  • Date: Fri, 01 Aug 2014 16:00:56 -0700

Hi Prabha,

What is the MQ version you are using ? and which/where the NSPR/NSS libaries are loaded ? on what system/OS ?

We haven't seen real memory leak from OpenMQ C-API library. It's known that NSS (used by MQ C-API library) 's arena code may confuse memory analysis tools. The shared libraries libsoftokn3, libnss3.so in your valgrind memory report below are NSS libraries, so what you have seen could be due to that or one time 'leak' due to global static data. If you do see real memory leak, please provide sample code, we will look into it.

Thanks,
amy

On 07/31/2014 05:18 AM, prabha.lakshmi@... wrote:
Hi,

I am using Open Message Queue in my  C++ project.

when i run my project under valgrind it shows many memory leak error
from the location MQCreateConnection(...)

When i checked the documentation of this API they have mentioned some
functions(MQFreeConnection) to be called inorder to free the memory
been allocated.

Even if call those functions the Memeory leak is still happening.

Please find sample valgrind memory report.

==6539== 17 bytes in 1 blocks are still reachable in loss record 26 of
282
==6539==    at 0x4A068FE: malloc (vg_replace_malloc.c:270)
==6539==    by 0x36C7C0FADF: NSSRWLock_New_Util (in
/usr/lib64/libnssutil3.so)
==6539==    by 0x36C7C15374: SECOID_Init (in /usr/lib64/libnssutil3.so)
==6539==    by 0x53F6007: ??? (in /usr/lib64/libsoftokn3.so)
==6539==    by 0x53F62E6: ??? (in /usr/lib64/libsoftokn3.so)
==6539==    by 0x36C7436266: ??? (in /usr/lib64/libnss3.so)
==6539==    by 0x36C7436BE6: ??? (in /usr/lib64/libnss3.so)
==6539==    by 0x36C7449E99: SECMOD_LoadModule (in
/usr/lib64/libnss3.so)
==6539==    by 0x36C7449F8F: SECMOD_LoadModule (in
/usr/lib64/libnss3.so)
==6539==    by 0x36C741A453: ??? (in /usr/lib64/libnss3.so)
==6539==    by 0x36C741AA96: NSS_NoDB_Init (in /usr/lib64/libnss3.so)
==6539==    by 0x4C79039: once_fn_nss_init (in
/opt/glassfish3/mq/lib64/libmqcrt.so.1)
==6539==    by 0x36C5C1B1F9: PR_CallOnce (in /lib64/libnspr4.so)
==6539==    by 0x4C790A0: callOnceNSS_Init (in
/opt/glassfish3/mq/lib64/libmqcrt.so.1)
==6539==    by 0x4C592C3: Connection::openConnection(Properties*,
UTF8String*,     UTF8String*, UTF8String*, void
(*)(_MQConnectionHandle, _MQStatus, void*), void*, int (*)(void
(*)(void*), void*, void*), void*) (in
/opt/glassfish3/mq/lib64/libmqcrt.so.1)
==6539==    by 0x4C7D700: MQCreateConnectionExt (in
/opt/glassfish3/mq/lib64/libmqcrt.so.1)
==6539==    by 0x4C7D89B: MQCreateConnection (in
/opt/glassfish3/mq/lib64/libmqcrt.so.1)
==6539==    by 0x40121C: consumer (in
/home/gpcs/Siva/Study/OpenMQ/a.out)
==6539==    by 0x401B01: main (in /home/gpcs/Siva/Study/OpenMQ/a.out)

Thank You,

Prabha



Re: Memory Leak while creating connection in MQ C API

Amy Kang 08/01/2014
Terms of Use; Privacy Policy; Copyright ©2013-2017 (revision 20160708.bf2ac18)
 
 
Close
loading
Please Confirm
Close