Title: webapp termination causes memory leaks
Type: crash Severity: major
Components: Core Versions: Jython 2.7, Jython 2.5
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: onlygecko, zyasoft
Priority: Keywords:

Created on 2014-04-25.08:21:27 by onlygecko, last changed 2014-07-05.18:46:44 by onlygecko.

msg8308 (view) Author: (onlygecko) Date: 2014-04-25.08:21:26
Terminating a modjy-Webapp within Tomcat causes a mermory leak on the server.

The problem can be easily reproduced with the modjy-webapp demo from the jython repository: Deploy the app, stop the app.

It's the same behaviour described in the mailinglist-post [1].

Profiling Tomcat after stopping the app, according to guide [2] shows, that the main reason for the leak could be an instance of "RefReaperThred". This issue could also correspond to issue 2127 [3].

I verfied this problem within several Tomcat versions under Linux and Windows with Jython 2.5.3 and Jython 2.7.b1.

[1] Jython User-Mailinglist post "How can I shut down Jython cleanly?":

[2] Anatomy of a PermGen Memory Leak:

[3] Jython Issue 2127:
msg8443 (view) Author: (onlygecko) Date: 2014-05-20.07:40:53
There was also an IRC discussion corresponding to this problem:
msg8527 (view) Author: Jim Baker (zyasoft) Date: 2014-05-22.00:50:23
Looks like we need to fix the underlying problem in #2127
msg8691 (view) Author: Jim Baker (zyasoft) Date: 2014-06-19.00:39:38
Duplicate of #2127
msg8857 (view) Author: Jim Baker (zyasoft) Date: 2014-07-01.04:00:46
#2127 was recently fixed
msg8867 (view) Author: (onlygecko) Date: 2014-07-05.18:46:43
Unfortunately the bug still occurs.

I've tested the Modjy demo webapp with the current repository versions of Jim Baker[1] and Jython [2]. After undeploying the app via the Tomcat manager resources are still locked. VisualVM points to the ApplicationShutdownHook.

Am I doing something wrong? Has anyone a war-example which can be stopped / undeployed without memory leaks? 

Date User Action Args
2014-07-05 18:46:44onlygeckosettype: crash
messages: + msg8867
2014-07-01 04:00:46zyasoftsetstatus: open -> closed
messages: + msg8857
2014-06-19 00:39:38zyasoftsetresolution: duplicate
messages: + msg8691
2014-05-22 00:50:24zyasoftsetnosy: + zyasoft
messages: + msg8527
2014-05-20 07:40:53onlygeckosetmessages: + msg8443
2014-04-25 08:21:27onlygeckocreate