[jboss-dev-forums] [jBPM Development] - Spring integration, memory leaks

Daniel Murygin do-not-reply at jboss.com
Tue Jan 25 03:57:55 EST 2011


Daniel Murygin [http://community.jboss.org/people/n2] created the discussion

"Spring integration, memory leaks"

To view the discussion, visit: http://community.jboss.org/message/582960#582960

--------------------------------------------------------------
I noticed a memory leak in jBPM Spring integration while profiling my application.
I'm using jBPM 4.4 and Spring 2.5.6.

jBPM calls +org.jbpm.pvm.internal.env.SpringContext.get(Class<T> type)+ to retrieve Spring beans. This method calls +org.springframework.context.ApplicationContext.getBeanNamesForType(type+) everytime to get the bean anme for the class. These calls causes 30 MB memory usage after short runtime with only one user. 

Nebeans Profiler snapshot:
 https://dl.dropbox.com/u/342869/SpringContext.png  https://dl.dropbox.com/u/342869/SpringContext.png 

Since +getBeanNamesForType(type+) reads names from the static Spring configuration +SpringContext.get+ should cache the names after reading. I added a simple static +Hashmap+ to SpringContext which saved 25 MB ram. 

I added a patch for maven module +pvm+ of the jBPM-4.4 sources. A more sophisticated cache solution may be required in other environment with multiple Spring +ApplicationContexts+ in one JVM.

- Daniel
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/582960#582960]

Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110125/35726a8a/attachment.html 


More information about the jboss-dev-forums mailing list