ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexIBM MQ API SupportMemory leak in C++ iterator over properties

Post new topicReply to topic
Memory leak in C++ iterator over properties View previous topic :: View next topic
Author Message
hdfan2
PostPosted: Tue Dec 17, 2019 12:21 am Post subject: Memory leak in C++ iterator over properties Reply with quote

Newbie

Joined: 17 Dec 2019
Posts: 2

Hi there!
I'm writing C++ application that uses XMS to send/receive messages. After I receive message I want to iterate over its properties to process their names/values. To do so, I used the following code:
Code:

for (xms::Iterator it=lpMsg->getProperties(); it.hasNext(); ) {
     xms::Property *prop=reinterpret_cast<xms::Property*>(it.getNext());
     // Do something with prop->name() and other prop members
     delete prop;
     }

However, I get memory leak in lpMsg->getProperties(). I'm using umdh Windows tool to check if it's actually memory leak.

lpMsg is properly deleted after that. I'm using latest XMS version (2.0.4).

What am I doing wrong? Any input or suggestion would be highly appreciated.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 17, 2019 5:28 am Post subject: Re: Memory leak in C++ iterator over properties Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26042
Location: Texas, USA

hdfan2 wrote:
I'm using latest XMS version (2.0.4).


Which version of the MQ client did you install to get that?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
hdfan2
PostPosted: Tue Dec 17, 2019 8:01 pm Post subject: Reply with quote

Newbie

Joined: 17 Dec 2019
Posts: 2

I'm using MQ 9.1, but as far as I remember, I've installed XMS 2.0.4 separately from IBM site.

BTW, I tried IBM samples, provided with XMS, and C sample (SampleConsumerC.c) leaks just fine. It's not just very apparent due to low TPS.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Dec 18, 2019 5:37 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26042
Location: Texas, USA

hdfan2 wrote:
BTW, I tried IBM samples, provided with XMS, and C sample (SampleConsumerC.c) leaks just fine. It's not just very apparent due to low TPS.


If the IBM supplied XMS library leaks using the IBM supplied source code, then it's nothing you're doing.

PMR time.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 18, 2019 5:38 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20385
Location: LI,NY

hdfan2 wrote:
I'm using MQ 9.1, but as far as I remember, I've installed XMS 2.0.4 separately from IBM site.

BTW, I tried IBM samples, provided with XMS, and C sample (SampleConsumerC.c) leaks just fine. It's not just very apparent due to low TPS.

Wrong installation! Uninstall XMS and install the full client with messaging services (JMS/XMS) from IBM. XMS is now part of the product and should not be installed alone!. Try again and see if the leak has been fixed.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ API SupportMemory leak in C++ iterator over properties
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.