tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Gallimore (Jira)" <j...@apache.org>
Subject [jira] [Resolved] (TOMEE-2750) Memory leak on undeploy
Date Wed, 11 Dec 2019 10:20:00 GMT

     [ https://issues.apache.org/jira/browse/TOMEE-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jonathan Gallimore resolved TOMEE-2750.
---------------------------------------
    Resolution: Fixed

> Memory leak on undeploy
> -----------------------
>
>                 Key: TOMEE-2750
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2750
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 7.0.6, 7.1.1, 8.0.0-Final
>            Reporter: Thomas Andraschko
>            Assignee: Thomas Andraschko
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 7.0.7, 7.1.2, 8.0.1
>
>
> Tomcat has a cache for the parsed WebXML descriptor:
> https://github.com/apache/tomcat/blob/master/java/org/apache/catalina/startup/ContextConfig.java#L166
> When undeployed, it seems that the cache is not cleared. In plain Tomcat it's not as
harmfull as the WebXML descriptor only has some primitive informations and does not use much
memory.
> In case of TomEE we inherit the WebXML:
> https://github.com/apache/tomee/blob/master/tomee/tomee-catalina/src/main/java/org/apache/catalina/startup/OpenEJBContextConfig.java#L373
> This is totally ok but it's an inner class, which holds reference to the outer OpenEJBContextConfig
(which has ref to the StandardContext, therefore WebBeansContext and so on...)
> I think the easiest way is to make the OpenEJBWebXml static, which fixes the bug and
is more aligned with the original Tomcat design of the WebXML descriptor.
> After direct undeploy, TomEE needs ~150MB. After my fix it only takes ~50MB.
> It could be that Tomcat will cleanup the cache later or that Tomcat has a bug in its
cleanup logic.
> I will check this later but indepedent of this, we should apply my fix (PR follows) which
prevents unintended behaviors when using non-static inner classes.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message