We should remove the HandleMark mechanism which is a leftover from when Metadata was in Handles. There aren't many places where we have a lot of Handles that would benefit from the optimization of bulk cleanup of Handles and it's really easy to have unnecessary Handles that GC has to process.
We should make Handle an RAII class whose destructor removes the Handle from the GC list, like methodHandle and constantPoolHandle.
The main problem with doing this is that Handle is most commonly passed as foo(Handle h), and to avoid unnecessary copy constructors and destructors, they'd all have to be changed to: foo(const Handle& h); So it's a lot of changes.
Another bug caused by a missing HandleMark was just fixed.
We should make Handle an RAII class whose destructor removes the Handle from the GC list, like methodHandle and constantPoolHandle.
The main problem with doing this is that Handle is most commonly passed as foo(Handle h), and to avoid unnecessary copy constructors and destructors, they'd all have to be changed to: foo(const Handle& h); So it's a lot of changes.
Another bug caused by a missing HandleMark was just fixed.
- relates to
-
JDK-8273639 tests fail with "assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark"
-
- Resolved
-