Integrated: 8306456: Don't leak _worklist's memory in PhaseLive::compute

Johan Sjölen jsjolen at openjdk.org
Fri Apr 21 13:39:57 UTC 2023


On Wed, 19 Apr 2023 14:21:13 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> `PhaseLive::compute` used to do this: `_worklist = new (_arena) Block_List();`. This allocates the `Block_List` to the `_arena`, but the backing array is allocated on the resource area: `Block_List() : Block_Array(Thread::current()->resource_area()), _cnt(0) {}`. This causes at most 5 worklists and at least 4 worklists to be created and not freed until the compilation is finished. This patch allocates the worklist within `PhaseLive::compute`:s local resource mark.

This pull request has now been integrated.

Changeset: 6e77e14f
Author:    Johan Sjölen <jsjolen at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/6e77e14fdbf4ab083020467cf2ecb8225f3dcbc7
Stats:     18 lines in 2 files changed: 2 ins; 3 del; 13 mod

8306456: Don't leak _worklist's memory in PhaseLive::compute

Reviewed-by: kvn, dlong

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

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


More information about the hotspot-compiler-dev mailing list