Author |
Message
|
sumitha |
Posted: Mon Aug 11, 2008 3:04 am Post subject: Memory leak issue with JavaCompute Node |
|
|
Newbie
Joined: 22 May 2008 Posts: 5
|
I have observed that whenever a message is being processed in the JavaCompute Node the memory usage by DataFlowEngine of the execution group is increasing and even after completion of the processing the memory is not getting released.
Also we noticed that the variation in the memory usage is not a fixed change. It is fluctuating with the time.
WMB version: 6.0.0.3
Platform: AIX
Please can anyone suggest a resolution to this ?
Please see the code below :
package www.test.com;
import com.ibm.broker.javacompute.MbJavaComputeNode;
import com.ibm.broker.plugin.*;
public class TEST_SIMPLE_JavaCompute extends MbJavaComputeNode {
public void evaluate(MbMessageAssembly contact admin) throws MbException {
MbOutputTerminal out = getOutputTerminal("out");
MbOutputTerminal alt = getOutputTerminal("alternate");
MbMessage inMessage = contact admin.getMessage();
// create new message
MbMessage outMessage = new MbMessage(inMessage);
MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,outMessage);
String temp = "THIS IS A SAMPLE STRING";
try {
//<hr />
// Add user code below
// End of user code
//<hr />
// The following should only be changed
// if not propagating message to the 'out' terminal
out.propagate(outAssembly);
} finally {
// clear the outMessage
outMessage.clearMessage();
}
}
} |
|
Back to top |
|
 |
sebastianhirt |
Posted: Mon Aug 11, 2008 4:23 am Post subject: |
|
|
Yatiri
Joined: 07 Jun 2004 Posts: 620 Location: Germany
|
Is the memory usage once allocated staying constant? It is normal behaviour, that once by the execution group allocated memory is only released on process termination of th execution group. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Aug 11, 2008 2:28 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You might want to read up on java garbage collection...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sumitha |
Posted: Tue Aug 19, 2008 12:35 am Post subject: |
|
|
Newbie
Joined: 22 May 2008 Posts: 5
|
The memory usage keep on increasing as long as the message flow is processing the messages and finally the execution group gets abended.
Is there any documentation about the java garbage collection in MB ? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 19, 2008 3:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sumitha wrote: |
The memory usage keep on increasing as long as the message flow is processing the messages and finally the execution group gets abended.
Is there any documentation about the java garbage collection in MB ? |
Is the last action in your JCN }finally {message.clear();} ?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
JLRowe |
Posted: Tue Aug 19, 2008 6:37 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
You should not have to worry about garbage collection as long as you do not hold on to object references, your code looks fine to me: the evaluate() method does not hold on to any references so I don't see why you are running out of memory.
The memory consumed by java does go up and down, this is because it is usually better to release memory to the OS when the heap is lightly used, and to grab more memory when needed. It may take some time to release memory as there is little point in constantly deallocating and reallocating memory. |
|
Back to top |
|
 |
|