Author |
Message
|
hdfan2 |
Posted: Tue Dec 17, 2019 12:21 am Post subject: Memory leak in C++ iterator over properties |
|
|
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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
Vitor |
Posted: Tue Dec 17, 2019 5:28 am Post subject: Re: Memory leak in C++ iterator over properties |
|
|
![](images/avatars/905340816499abc1cdfb07.jpg) Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
hdfan2 |
Posted: Tue Dec 17, 2019 8:01 pm Post subject: |
|
|
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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
Vitor |
Posted: Wed Dec 18, 2019 5:37 am Post subject: |
|
|
![](images/avatars/905340816499abc1cdfb07.jpg) Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
fjb_saper |
Posted: Wed Dec 18, 2019 5:38 am Post subject: |
|
|
![](images/avatars/gallery/misc/2.gif) Grand High Poobah
Joined: 18 Nov 2003 Posts: 20700 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. ![](images/smiles/innocent.gif) _________________ MQ & Broker admin |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
gbaddeley |
Posted: Tue Mar 12, 2024 2:00 pm Post subject: |
|
|
![](images/avatars/gallery/Star Wars/movie_star_wars_yoda.gif) Jedi Knight
Joined: 25 Mar 2003 Posts: 2501 Location: Melbourne, Australia
|
Double banger? AI generated response and link to irrelevant web site. _________________ Glenn |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
bruce2359 |
Posted: Wed Mar 13, 2024 1:41 pm Post subject: |
|
|
![](images/avatars/58715422151eef88d5f6e3.jpg) Poobah
Joined: 05 Jan 2008 Posts: 9407 Location: US: west coast, almost. Otherwise, enroute.
|
JeanParcks reported to bannisher-in-chief. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
|