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 » Clearing Shared Variables from memory

Post new topic  Reply to topic
 Clearing Shared Variables from memory « View previous topic :: View next topic » 
Author Message
rk9999
PostPosted: Thu Mar 04, 2010 3:13 pm    Post subject: Clearing Shared Variables from memory Reply with quote

Newbie

Joined: 04 Mar 2010
Posts: 2

Hi,

I am trying to save a process a file with multiple records and i read one record at a time rather then the whole file.
As my first record goes thru i save it in a SHARED variable and then return to the file get the next one. If the ID of the second message is the same as the previous one(saved in the shared variable) i append it to that and get the next record and if that ID differs from the previous message i propage the previous message to the Q.

I use a few shared variables to save some values at flow level because the Environment tree is wiped out after processing one record.

This is using up all the memory on the server/local machine and even after the file and the flow is done it does not release the memory.

Is there a way to clear the memory after finishing the file?
Do I have any alternate methods to do what I am doing?

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Mar 04, 2010 4:43 pm    Post subject: Reply with quote

Grand High Poobah

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

Moved to more relevent section
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Mar 04, 2010 4:52 pm    Post subject: Re: Clearing Shared Variables from memory Reply with quote

Grand High Poobah

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

rk9999 wrote:
I am trying to save a process a file with multiple records and i read one record at a time rather then the whole file.


You have 2 issues here - you're using a file rather than messages, and the records in the file have affinity; i.e. the processing of one record depends on the previous record.

rk9999 wrote:
As my first record goes thru i save it in a SHARED variable and then return to the file get the next one. If the ID of the second message is the same as the previous one(saved in the shared variable) i append it to that and get the next record and if that ID differs from the previous message i propage the previous message to the Q


I'm assuming for the rest of the post that by ID you mean some business value in the file record. I'm also assuming that all of the records with the same ID occur sequentially in the file (or your current solution is toast).

rk9999 wrote:
Do I have any alternate methods to do what I am doing?


Well the simple solution is to split the file by ID. As I indicate above, you must be sorting the file by ID so spliting it is a fairly simple task.

Failing that you could use a Collector node to group up the various IDs and send them forward.

Other design solutions, possibly better ones, are undoubably possible.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rk9999
PostPosted: Fri Mar 05, 2010 9:36 am    Post subject: Re: Clearing Shared Variables from memory Reply with quote

Newbie

Joined: 04 Mar 2010
Posts: 2

Vitor wrote:
rk9999 wrote:
I am trying to save a process a file with multiple records and i read one record at a time rather then the whole file.


You have 2 issues here - you're using a file rather than messages, and the records in the file have affinity; i.e. the processing of one record depends on the previous record.

rk9999 wrote:
As my first record goes thru i save it in a SHARED variable and then return to the file get the next one. If the ID of the second message is the same as the previous one(saved in the shared variable) i append it to that and get the next record and if that ID differs from the previous message i propage the previous message to the Q


I'm assuming for the rest of the post that by ID you mean some business value in the file record. I'm also assuming that all of the records with the same ID occur sequentially in the file (or your current solution is toast).

rk9999 wrote:
Do I have any alternate methods to do what I am doing?


Well the simple solution is to split the file by ID. As I indicate above, you must be sorting the file by ID so spliting it is a fairly simple task.

Failing that you could use a Collector node to group up the various IDs and send them forward.

Other design solutions, possibly better ones, are undoubably possible.


Thanks for the quick reply ... yes we are looking into a different solution as well.

So there no way to clear the SHARED variables in the memory even after the flow is done processing a message? or even the file?
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Mar 05, 2010 9:48 am    Post subject: Re: Clearing Shared Variables from memory Reply with quote

Grand High Poobah

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

rk9999 wrote:
So there no way to clear the SHARED variables in the memory even after the flow is done processing a message? or even the file?


Not that I'm aware of. I'll leave it to better qualified people than me to discuss the details of WMB memory recovery, and also suggest other alternatives to you.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Fri Mar 05, 2010 11:18 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

Quote:
This is using up all the memory on the server/local machine and even after the file and the flow is done it does not release the memory.


We are running WMB 6.0 (going to 7 later this year) on AIX and have been told by IBM that once an execution group (EG) grabs memory it does not release it back to the OS. Basically that the EG saves that memory because it needed that much in the past and might need it in the future so it holds onto it.

The only way to get that memory back is to restart the EG. This would only be feasible if this was a special situation (large data load?) and not a daily occurrence.
Back to top
View user's profile Send private message
Mandeep
PostPosted: Fri Mar 26, 2010 11:46 pm    Post subject: Reply with quote

Apprentice

Joined: 03 May 2004
Posts: 33

We have faced this problem with Shared Variables:

If you try to change the shared Variable value (once populated/initialized by the first instance of the flow) by every message being processed - which you are doing here - it eats memeory exponentially. And then EG doesn't releases it unless restarted.

So check and change the design in case:
You are trying to change the shared variable value every time you process a message?

Once initialized you should change its value very rarely. Good design would be to check if its popualted you should not re-assign it in the same flow, unless the condition becomes true very rarely like change of the date/year etc..
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Sat Mar 27, 2010 2:31 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

Mandeep wrote:
it eats memeory exponentially.


This sounds very dubious and if true worthy of futher investigation / a PMR. How did you prove this? Did you ask IBM for advice?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Mar 27, 2010 8:42 am    Post subject: Re: Clearing Shared Variables from memory Reply with quote

Grand High Poobah

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

Vitor wrote:
rk9999 wrote:
So there no way to clear the SHARED variables in the memory even after the flow is done processing a message? or even the file?


Not that I'm aware of. I'll leave it to better qualified people than me to discuss the details of WMB memory recovery, and also suggest other alternatives to you.

@rk9999 You are using the shared memory for the wrong purpose...
What you need to do is determine whether or not the record you receive is the last record and create your output. (Detach from shared and attach to output tree). Not sure whether this will release any memory...

Anyways as stated above there are other and better solutions available like splitting the file, using a collector node etc...

You could potentially use this for automatic splitting of the file.
Use file input and file output nodes and change the name when the ID changes.
All you have in shared memory is then the ID and that should not be such a burden...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Mandeep
PostPosted: Mon Mar 29, 2010 1:32 am    Post subject: Reply with quote

Apprentice

Joined: 03 May 2004
Posts: 33

A simple test would be:

Check memory first time when Shared Variable is initialized i.e. at the first hit, you would see it taking considerable memory. Similarily, if you are re assigning a value to it every time, it would add/consume that amount of memeory each time.

Yes we worked with IBM for this. We were facing issues with Shared Variable value not visible in the nested subflow ( we had 3 levels of subflows). To overcome this the developer was creating a new Shared Variable with same name in the 3rd level subflow and assigning it the value every time, which was a mistake.

So a check if a shared variable is populated, then do not re-assign it, worked fine for us. Unless the condition (at which value should be refreshed) becomes true - which should not be very often
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Mon Mar 29, 2010 1:37 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

Mandeep wrote:

Yes we worked with IBM for this.


So did they confirm it as an issue? Working as designed? Fix pending? Or was your "work around" of not updating it too often where it all ended?
Back to top
View user's profile Send private message
Mandeep
PostPosted: Mon Mar 29, 2010 3:52 am    Post subject: Reply with quote

Apprentice

Joined: 03 May 2004
Posts: 33

Hi, yes they confirmed there is no ready made solution available for this probelm at this point in time.

We were suggested to remove the 3rd level of subflow and move the subflow code one level up, in a compute node may be.

We instead declared the same Shared Variable at level 3, as this subflow was being reused in other flows as well.

We have informed the onsite team about the work around, who is dealing with IBM.

Would you suggest as an independent (without involving the client who is busy with Go Live at this stage) I can raise it with IBM? If yes, then how?
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 » Clearing Shared Variables from memory
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.