Can I check whether there's an active ResourceMark?

Tony Printezis tprintezis at
Mon Sep 9 20:01:30 UTC 2013

Frederik and Stefan,

Many thanks for the info. I think the ...->current_resource_mark() != 
NULL version is what's appropriate for what I want to do.


On 9/9/13 1:25 PM, frederic parain wrote:
> 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.
> Fred
> 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

Tony Printezis | Staff Software Engineer | Twitter

tprintezis at

More information about the hotspot-gc-dev mailing list