Bug 1037636 - [GSS] (6.2.x) Memory leak in JBoss AS / Hibernate JPA integration
Summary: [GSS] (6.2.x) Memory leak in JBoss AS / Hibernate JPA integration
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JPA
Version: 6.2.0
Hardware: All
OS: All
unspecified
urgent
Target Milestone: CR1
: EAP 6.2.1
Assignee: Scott Marlow
QA Contact: Zbyněk Roubalík
URL:
Whiteboard:
Depends On: 1040733
Blocks: eap62-cp01-blockers
TreeView+ depends on / blocked
 
Reported: 2013-12-03 14:16 UTC by Michal P
Modified: 2017-10-10 00:16 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A memory leak that occurred when checking the query cache statistics has been resolved in this release of JBoss EAP 6. 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)' ---- An invalid query name was being used when checking the query cache statistics, which returned invalid results and also caused each invalid query name to be added to the Hibernate statistics. This release no longer uses an invalid query name when checking the query cache statistics.
Clone Of:
: 1040733 (view as bug list)
Environment:
Last Closed: 2014-02-24 20:14:39 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-2593 Critical Closed Memory leak in JBoss AS / Hibernate JPA integration 2016-08-22 22:07:25 UTC

Description Michal P 2013-12-03 14:16:31 UTC
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.

Comment 4 JBoss JIRA Server 2013-12-06 17:19:40 UTC
Scott Marlow <scott.marlow@redhat.com> updated the status of jira WFLY-2593 to Resolved

Comment 5 JBoss JIRA Server 2013-12-06 17:19:40 UTC
Scott Marlow <scott.marlow@redhat.com> 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).

Comment 6 JBoss JIRA Server 2013-12-06 17:19:52 UTC
Scott Marlow <scott.marlow@redhat.com> updated the status of jira WFLY-2593 to Closed

Comment 7 JBoss JIRA Server 2013-12-06 17:45:27 UTC
Michael Kozak <lklm@wp.pl> 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 ?

Comment 8 JBoss JIRA Server 2013-12-06 18:12:48 UTC
Scott Marlow <scott.marlow@redhat.com> 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!  :-)

Comment 14 Scott Mumford 2014-01-20 05:58:46 UTC
Marking for inclusion in 6.2.1 release notes documentation.

Comment 15 Scott Mumford 2014-01-23 03:30:33 UTC
Requesting information about how this memory leak was resolved to complete the release notes draft started in the Doc Text field.

Comment 16 Martin Simka 2014-01-23 13:58:03 UTC
Verified in 6.2.1.CP.CR1-patch

Comment 17 Scott Marlow 2014-01-23 15:55:50 UTC
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)'

Comment 18 Scott Mumford 2014-01-23 23:53:57 UTC
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.

Comment 19 Scott Marlow 2014-01-24 03:04:33 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.