[
https://jira.jboss.org/jira/browse/JBPM-1839?page=com.atlassian.jira.plug...
]
Damon Brown updated JBPM-1839:
------------------------------
Attachment: jbpm-classloader.zip
This zip bundle contains the Eclipse projects used for testing and diagnosis. It also
contains a ready-to-go drop-in jar (compiled with Java 6). This classloader has been
tested with jBPM 3.2.6.GA. YMMV.
To enable the shared classloader, add the following line to your jbpm.cfg.xml:
<bean name="jbpm.processClassLoader"
class="org.jbpm.instantiation.SharedPCLFactory" singleton="true"
/>
Testing was done with jmap and jhat. Histogram analysis showed multiple classloaders
being stored within the PermGen space. Since a new classloader was being created per
action, the overhead of creating the classloader, loading the class bytes, etc, is
profound (when reading from a database). Under load, the server quickly ran out of
PermGen space. Note that if the process action files are in the server's classpath
(the usual test case), the PermGen space will *not* be polluted. The par must be stored
in the database and classes retrieved at runtime from the database.
This classloader implementation attempts to create and associate one classloader per
process definition. jhat/jmap histogram analysis indicates that a single classloader per
process definition is created.
Testing has been performed with oracle and mysql. This test bundle includes the mysql
tests. The same behavior was observed using either database store.
If you've looked at the source for the classloader, it uses a
InheritableThreadLocal<ProcessDefinition> object to refer to the current
ProcessDefinition's reference. This is due to the lazy proxy created by hibernate to
associate the ProcessDefinition object with the current session. If the reference were a
strong or weak reference, the session would go out of scope as the process executes (or is
GC'd), and the bytes would not be able to be retrieved from the database.
Whenever ActionHandler is executed a new ProcessClassLoader is
instantiated
----------------------------------------------------------------------------
Key: JBPM-1839
URL:
https://jira.jboss.org/jira/browse/JBPM-1839
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Core Engine
Reporter: Thomas Diesler
Fix For: jBPM 4.0.x
Attachments: jbpm-classloader.zip
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira