Can I check whether there's an active ResourceMark?

frederic parain frederic.parain at
Mon Sep 9 10:25:25 PDT 2013

Hi Tony,

The _nesting field of the ResourceArea class provides the
number of nested ResourceMarks (_nesting < 0 means no
ResourceMark has been set up). This field is only available
in debug builds, but it could do the job for an assert.


On 09/09/2013 18:58, Tony Printezis wrote:
> Hi guys,
> (didn't know what list to ask this, starting with GC!)
> Is there a way to check whether there's an active ResourceMark? I have a
> method that requires that the caller (or one of the callers) has set up
> a ResourceMark and I wanted to check for that with an assert. Thanks!
> Tony

Frederic Parain - Oracle
Grenoble Engineering Center - France
Phone: +33 4 76 18 81 17
Email: Frederic.Parain at

More information about the hotspot-gc-dev mailing list