The leak exists in AS integration code with Hibernate JPA. When a persistence unit is deployed which has 2nd level cache and statistics enabled each query for "query-cache" elements produces new elements. This issue arised when we deployed jmxproxy application which was queried from Zabbix installation. For some MBean queries the implementation visits all MBeans deployed on the server. This kills the JVM after about 7 days. Version-Release number of selected component (if applicable): 7.1.1 community and EAP 6.2 Beta. More info and possible solution in JBoss Issue Tracker.
Scott Marlow <scott.marlow> updated the status of jira WFLY-2593 to Resolved
Scott Marlow <scott.marlow> made a comment on jira WFLY-2593 Cannot reproduce the leak in WildFly 8 and *should* be fixed in next EAP 6.x release (you could open a ticket with Red Hat support asking for the fix for your production environment).
Scott Marlow <scott.marlow> updated the status of jira WFLY-2593 to Closed
Michael Kozak <lklm> made a comment on jira WFLY-2593 Sorry Scott I didn't check the WildFly at all. I just assumed this issue tracker is for JBoss 7 AS too since the original space is closed. I already created an issue in Red Hat issue tracker. The link is available at this page in "Bugzilla References". I wonder how can I view the statistics in WildFly. I see there is no "hibernate-persistence-unit" under /deployment=jmxp.ear.ear/subdeployment=jmxp.ejb.jar/subsystem=jpa. Was the removal of this functionallity intended ?
Scott Marlow <scott.marlow> made a comment on jira WFLY-2593 No need to apologize, this was an excellent bug report (+10 for providing a test case ready to be used). Also, your test case didn't work on WildFly right away, Brian had to fix WFLY-2609 first. So, you also helped us to find that. {quote} I wonder how can I view the statistics in WildFly. I see there is no "hibernate-persistence-unit" under /deployment=jmxp.ear.ear/subdeployment=jmxp.ejb.jar/subsystem=jpa. Was the removal of this functionallity intended ? {quote} This is the WFLY-2609 bug that you also helped me find! :-)
Marking for inclusion in 6.2.1 release notes documentation.
Requesting information about how this memory leak was resolved to complete the release notes draft started in the Doc Text field.
Verified in 6.2.1.CP.CR1-patch
A memory leak was fixed that occurred when checking the query cache statistics. The leak occurred each time that jboss-cli was invoked to check the query cache. For example the following command would cause the leak: ./jboss-cli.sh --connect --command='/deployment=DeploymentName.ear/subdeployment=MyEjb.jar/subsystem=jpa/hibernate-persistence-unit=DeploymentName.ear\/MyEjb.jar#MyPersistenceUnit:read-children-resources(child-type=query-cache)'
Thanks for the new content Scott. I've replaced my draft intro with yours. I still need to know how the leak was fixed, though.
The code change is here https://github.com/jbossas/jboss-eap/pull/721/files. The "how the leak was fixed" is that we no longer use an invalid query name when checking the query cache statistics. We found that passing an invalid query name, not only returned invalid results but it caused each invalid query name to be added to the Hibernate statistics.