|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
memory leak in MQSI plugin examples ?! |
« View previous topic :: View next topic » |
Author |
Message
|
mpuetz |
Posted: Sat Mar 16, 2002 2:22 pm Post subject: |
|
|
Centurion
Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services
|
Hi,
after some interesting deployment nightmares (brokers
crashing randomly leaving execution groups in an inconsistent
state, even after restarting the broker) with my
custom plugin nodes I eventually found out, that the
context and all attributes must be freed manually in the
deleteNodeContext() function. I found this out only after
analyzing some of the sources of other plugins which do
this explicitly. What was totally confusing to me was
the following fact: The programming guide states you should
use the deleteContextNode() function to free plugin resources
created in the createNodeContext() function, hence I assumed
I should free the context myself. However looking at the
samples provided with MQSI (BipSampPluginNode.c) the default
context (which is provided by the plugin node wizard) is *not*
freed nor any mamory for the node attributes.
Also the wizard generated template doesn't free the context.
Therefore I was completely mislead into the assumption that freeing
the context and its attributes was taken
care of in the framework and only freeing additional resources
allocated in createNodeContext() was my responsibilty.
Apparently, the developer creating the BisSampPluginNode fell into
the same pit as I did, trusting the wizard to generate well formed
code which does nothing, but works *reliably*.
Thus, any MQSI developer monitoring this: Please, get the examples
and the wizard templates fixed ! Examples with mistakes like this
are not helpful, but are very confusing and cost a lot of time
(and money) to find out ! Especially since these mistakes don't show
up in the way that one anticipates.
Mow, after this little rant, I actually have a real question about the
plugin interface.
I can use detachElement() to remove a subtree from a message, but
there is actually no deleteElement() call in the interface. So, what
happens if I don't attach the element again at some other place ?
When will the memory of detached elements be freed (will it be freed
at all) ?
_________________ Mathias Puetz
IBM/Central WebSphere Services
WebSphere Business Integration Specialist |
|
Back to top |
|
 |
warrenpage |
Posted: Mon Mar 18, 2002 5:45 pm Post subject: |
|
|
Acolyte
Joined: 19 Feb 2002 Posts: 56 Location: Australia
|
Thanks for the info..
We had the same question about deleting elements. I assumed it did not free the space.
In the absence of a DeleteElement call we were planning on using the cnicopyelementtree call.
|
|
Back to top |
|
 |
CT |
Posted: Sat Apr 06, 2002 11:22 pm Post subject: |
|
|
Newbie
Joined: 05 Apr 2002 Posts: 3
|
What wizard you are refering to?
please tell me, How can i get it? |
|
Back to top |
|
 |
kirani |
Posted: Sun Apr 07, 2002 8:28 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
If you are using MQSI 2.0.2 or higher, you can generate sample plug-in code using SmartGuide in the control center. Mathias is talking about the same wizard here.
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|