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 Index » WebSphere Message Broker (ACE) Support » Memory leak with shared variable and parsing mime message

Post new topic  Reply to topic
 Memory leak with shared variable and parsing mime message « View previous topic :: View next topic » 
Author Message
m8
PostPosted: Thu Aug 25, 2011 5:47 am    Post subject: Memory leak with shared variable and parsing mime message Reply with quote

Newbie

Joined: 11 Feb 2011
Posts: 5

Hi,

I am trying to fix a memory leak in a flow
To find it, I splitted the flow into smaller flows and deploy them in different execution groups.
For now, it seems that there are 2 memory leaks but I dont understand why it happens.

The first leak involves the use of a shared variable.
Code:

DECLARE activeTimers SHARED ROW;
CREATE COMPUTE MODULE FileManager_Check
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      DECLARE localTimers ROW;
      SET localTimers.Timers = activeTimers.Timers;

      -- ...

      DELETE FIELD activeTimers.Timers;
      SET activeTimers.Timers = localTimers.Timers;

      RETURN FALSE;
   END;
END MODULE;

The original flow is without the line DELETE FIELD activeTimers.Timers that fixed partially the leak. But why I need to explicitly delete the old field before do the copy?

The second leak concerns the parsing of a multipart mime message. My test flow is MIMEInput > Compute Node and with the esql code below :
Code:

CREATE COMPUTE MODULE FileManager_Extract
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      SET OutputLocalEnvironment = InputLocalEnvironment;

      CREATE LASTCHILD OF OutputRoot DOMAIN 'XMLNSC' PARSE(InputRoot.*[<].Parts.Part[1].Data.BLOB.BLOB CCSID 1208);
      RETURN FALSE;
   END;
END MODULE;

This flow increase its memory about 400MB for 4 hours and I don't know how to fix it or if there's something to fix.

Any help or advice would be most welcome
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Aug 25, 2011 6:12 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I would open a PMR on the shared variable issue. It is a bit odd.

I think the XMLNSC parsing "leak" is perfectly normal. I suspect your XML document is fairly large, and thus you end up needing a large amount of memory to hold it fully parsed.

And Broker implements it's own memory management, so even though the EG has increased it's size by 400Mb, doesn't mean that those 400Mb are holding the same data for that entire 4 hours.
Back to top
View user's profile Send private message
m8
PostPosted: Thu Aug 25, 2011 8:06 am    Post subject: Reply with quote

Newbie

Joined: 11 Feb 2011
Posts: 5

Every 2 minutes I send 2000 times the same 60kb message to the input node. It is a multipart MIME message, each part is a blob :
the first contains some xml data (a few bytes)
the second about 60 kb of data.
In my test flow, only the 1st part is parsed but I guess the full message is loaded in memory, ie about 120 Mb every 2min.
The original flow with the leak crashes in the production env because of out of memory so this memory increase is really suspicious for me (the first one with the shared variable as well but was fixed).
The EG with the test flow (only 2 nodes and one line of code) is still increasing (1224Mb now).
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Aug 25, 2011 8:16 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'm sorry, I missed something in your original post.

You are entering a compute node, creating a new message and parsing some XML data in OutputRoot , and then exiting the compute node without propagating... thus leaving the OutputRoot message dangling.

So I think it's the "RETURN FALSE" that's the source of your memory leak.
Back to top
View user's profile Send private message
m8
PostPosted: Fri Aug 26, 2011 2:52 am    Post subject: Reply with quote

Newbie

Joined: 11 Feb 2011
Posts: 5

Yes, I removed the propagate statements before the RETURN FALSE from the original code.
However, the leak is still there with a RETURN TRUE.
Back to top
View user's profile Send private message
jonatan bataz astudillo
PostPosted: Wed Aug 29, 2012 10:04 am    Post subject: Reply with quote

Newbie

Joined: 08 Feb 2012
Posts: 3

Excuse me did you solve this issue? i have the similar?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Memory leak with shared variable and parsing mime message
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.