Branch: refs/heads/master Home: https://github.com/rhq-project/rhq Commit: 5d8bd5cbcb1cbde0adcc5b0e7035a05db7150389 https://github.com/rhq-project/rhq/commit/5d8bd5cbcb1cbde0adcc5b0e7035a05db7... Author: Lukas Krejci lkrejci@redhat.com Date: 2014-08-28 (Thu, 28 Aug 2014)
Changed paths: M modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentManagement.java
Log Message: ----------- [BZ 1129910] Fix CL leak in agent plugin & AgentManagement MBean
The AgentManagement MBean is running inside the agent JVM.
When a restart operation of sorts is invoked from within the RHQ Agent plugin (as its operation), the invocation on the MBean (done through EMS) inherits the protection domain of the plugin classloader.
But the result of the operation is a new start of the plugin container (eventually) which will create a whole lot of new classloaders, all of which will inherit the protection domain and access control context of the original RHQ agent plugin classloader. The protection domain holds a reference to the classloader it is associated with.
As a result all the all the classloaders in the new "incarnation" of the plugin container will hold a reference to the original plugin classloader of the agent plugin. This will cause the classes from that agent plugin to never unload.
Rinse and repeat and you start to get OOMEs and full permgen.
rhq-commits@lists.fedorahosted.org