JDK-8273733 : Remove HandleMark
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 18
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2021-09-14
  • Updated: 2024-01-11
  • Resolved: 2024-01-11
Related Reports
Relates :  
Description
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.
Comments
Runtime Triage: This is not on our current list of priorities. We will consider this feature if we receive additional customer requirements.
11-01-2024