[jboss-jira] [JBoss JIRA] (WFLY-2593) Memory leak in JBoss AS / Hibernate JPA integration

Michael Kozak (JIRA) jira-events at lists.jboss.org
Tue Dec 3 07:14:06 EST 2013


    [ https://issues.jboss.org/browse/WFLY-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928153#comment-12928153 ] 

Michael Kozak edited comment on WFLY-2593 at 12/3/13 7:13 AM:
--------------------------------------------------------------

I didn't notice the fix is so simple.

I see scopedPUName is not used in your snippet so puService is not need either since getPersistenceUnitService does only a map lookup. I also noticed getQueryNames() handles the case when there are no statistics very well therefore I propose a simplified version: 

{code}
private boolean hasQuery(final PathElement element) {
    return getQueryNames().contains(element.getValue());
}
{code}
Correct me if I'm wrong.

Is there any chance the fix will land in EAP 6.2 ?
                
      was (Author: lklm):
    I didn't notice the fix is so simple.

I see scopedPUName is not used in your snippet so puService is not need either since getPersistenceUnitService does only a map lookup. I also noticed getQueryNames() handles the case when there are no statistics very well therefore I propose a simplified version: 

{code}
private boolean hasQuery(final PathElement element) {
    return getQueryNames().contains(element.getValue());
}
{code}
Correct me if I'm wrong.

Is there any chance the fix will land is EAP 6.2 ?
                  
> Memory leak in JBoss AS / Hibernate JPA integration
> ---------------------------------------------------
>
>                 Key: WFLY-2593
>                 URL: https://issues.jboss.org/browse/WFLY-2593
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JPA / Hibernate
>    Affects Versions: No Release
>         Environment: JBoss 7.1.1
> JBoss EAP 6.2 beta
>            Reporter: Michael Kozak
>            Assignee: Scott Marlow
>            Priority: Critical
>             Fix For: No Release
>
>         Attachments: jmxp.ear.ear, jmxp.tar.gz
>
>
> 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.
> The issue lies in org.jboss.as.jpa.hibernate4.management.HibernateStatisticsResource. getQueryNames() method requests query names from Hibernate and applies QueryName.queryName(query).getDisplayName() to change names. Then for all queries hasQuery() is called which invokes stats.getQueryStatistics(). Within this method Hibernate creates a new object to track the statistics because the name is not found.
> Possible solution is to reverse the work done by getDisplayName() but I'm not sure if it's the right thing to do.
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list