RFR: 8297638: Memory leak in case of many started-dead threads

Alan Bateman alanb at openjdk.org
Wed Jan 18 20:33:41 UTC 2023


On Wed, 18 Jan 2023 20:06:33 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

> Fix JDI leak when the debuggee creates a lot of threads, while at the same the debugger is not sending any commands. The lack of commands being sent results in code not being triggered that normally would clear out unreachable listeners and also clear out ObjectReferences queued for disposal.

Maybe you've tried this already but if listeners were changed to be a WeakHashMap<VMListener, Boolean> then this would expunge the stable entries. This would also avoid the O(n) search in removeUnreachableListeners and simplify many other operations. But maybe you are concerned about preserving the insertion order of the listeners?

-------------

PR: https://git.openjdk.org/jdk/pull/12081


More information about the serviceability-dev mailing list