Description of problem: ASConnection has a static thread pool which runs connection "cleaners" to prevent connection leakage. On every plugin container restart, the classes of the plugin are loaded anew, but the above thread pool is never shut down, leaving a thread running with a context classloader from the previous plugin container run. This leads to an eventual OOME because of depleted perm gen memory needed to hold all the classes from all the plugin container runs in the agent's lifetime. This problem has been made more apparent by our switch to HTTP client which is a much heavier library than the java's own Authenticator and HTTPUrlConnection we used before (but which had their own deal of problems). Version-Release number of selected component (if applicable): 4.11-SNAPSHOT How reproducible: always Steps to Reproduce: 1. inventory an AS7 2. periodically restart the plugin container without fully restarting the agent Actual results: out of memory error after a couple of repetitions (>10 usually, but depends on your perm gen set up) Expected results: no OOMEs Additional info:
commit 9d8b107414e926361ff2b7501e2094402de8e7f7 Author: Lukas Krejci <lkrejci> Date: Fri Mar 14 02:42:44 2014 +0100 [BZ 1076258] Fix classloader leak in as7 plugin The plugin-wide thread pool for closing stale connections was leaving threads running and those threads held on to the "old" plugin classloaders from previous plugin container "runs". The AS7 plugin now has a plugin lifecycle listener that shuts down that thread pool preventing that leak from happening.
Bulk closing of RHQ 4.11 issues, now that RHQ 4.12 is out. If you find an issue with those, please open a new BZ, linking to the old one.