Integrated: 8300032: DwarfParser resource leak
Daniel Jeliński
djelinski at openjdk.org
Mon Jan 16 07:00:18 UTC 2023
On Thu, 12 Jan 2023 12:08:51 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
> Please review this fix for DwarfParser cleaner.
>
> The original code registered the cleaner using a lambda that captured a reference to the parser object; as a result, the object was never GCed, and the cleaner never ran.
>
> In this version I moved the lambda creation to a static method, so that it can't capture a reference to the parser.
>
> Additionally, the new code uses a static cleaner; the cleaner object creation and cleanup are heavy operations (every cleaner comes with its own thread), and it's preferable to use a single shared cleaner where possible.
>
> I verified manually that the native `destroyDwarfContext` method is called after this fix. No new automated test. Existing tier1-2 tests continue to pass.
This pull request has now been integrated.
Changeset: fe7fca01
Author: Daniel Jeliński <djelinski at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/fe7fca0128ca3a7b514c49d1508ca64499a8bb8e
Stats: 8 lines in 1 file changed: 5 ins; 1 del; 2 mod
8300032: DwarfParser resource leak
Reviewed-by: cjplummer, sspitsyn
-------------
PR: https://git.openjdk.org/jdk/pull/11965
More information about the serviceability-dev
mailing list