From: <Tob...@dl...> - 2017-06-01 11:00:32
|
Hi, we are using Jython embedded in an Open Source Java application to allow our users to script certain behavior. We are really looking forward to the release of Jython 2.7.1, since we are currently using Jython 2.5.1 and weren't able to upgrade in the meantime due to various Jython bugs. Therefore, I am lurking on the developer mailing list to be up to date with the current development and I wanted to give you some early feedback to the RC2 of 2.7.1. One problem we encountered in an earlier Jython version (2.5.2) was the memory leak described in this bug report: http://bugs.jython.org/issue2026 . The bug is marked as fixed and I wanted to double check this. Therefore, I used the code snipped contained in the bug report to reconstruct the issue. The original issue seems to be resolved, but I encountered another problem. If I run the aforementioned code for a short period of time, the consumed heap increases quite fast: ~120MB after ~60 seconds. I inspected the heap dump and most the memory is consumed by a ConcurrentHashMap in PySystemState. I took a quick peek at the source and found this: PySystemState has a static final ConcurrentHashMap named sysClosers [0]. If a new PySystemStateCloser is created, a Key-Value-Pair of a WeakReference to a PySystemState and a reference to the PySystemStateCloser is added to the map [1], but never removed. Even if the WeakReference is finalized, if looks like the value will still remain in the map, since there is no removal code for broken references. I haven't created a bug report for this issue, since the RC is not officially announced, but I can do this if requested. Thanks for your efforts! Tobias [0] https://hg.python.org/jython/file/d4cd06b8c8c7/src/org/python/core/PySystemState.java#l199 [1] https://hg.python.org/jython/file/d4cd06b8c8c7/src/org/python/core/PySystemState.java#l1575 |