Sergii Shyika [
http://community.jboss.org/people/sshyika] created the discussion
"Re: KnowledgeBase keeps links to stateful sessions after disposing"
To view the discussion, visit:
http://community.jboss.org/message/640299#640299
--------------------------------------------------------------
Hi, Tihomir, thank you for reply. I am observing memory leak with stateless sessions too.
Here is simple code below:
public static void main(String... args) {
KnowledgeBase base = KnowledgeBaseFactory.newKnowledgeBase();
waitForKeyPress();
for (int i = 0; i ();
for (int i = 0; i < 1000; i++) {
list.add(new Date());
}
return list;
}
private static void waitForKeyPress() {
try {
System.in.read(new byte[2]);
} catch (IOException e) {
e.printStackTrace();
}
}
Here we simply create 500 stateless sessions and insert in each "heavy" object
(list of 1000 dates).
Below is jConsole screenshot made while programm waiting for second key press:
http://community.jboss.org/servlet/JiveServlet/showImage/2-640299-17450/M...
http://community.jboss.org/servlet/JiveServlet/downloadImage/2-640299-174...
As you can see java process consumes ~3Mb before and 22Mb after invoiking sessions.
Below is a screenshot of my debugger, that was made after invoiking sessions:
http://community.jboss.org/servlet/JiveServlet/showImage/2-640299-17451/D...
http://community.jboss.org/servlet/JiveServlet/downloadImage/2-640299-174...
You can see that knowledge base keeps 500 references to ProcessRuntime objects.
The picture is the same when we using statefull sessions and dispose them by dispose()
method.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/640299#640299]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]