RFR: 8281548: Add escape analysis tracing flag [v4]
Xin Liu
xliu at openjdk.java.net
Wed Feb 16 02:02:03 UTC 2022
On Tue, 15 Feb 2022 21:11:25 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> src/hotspot/share/opto/escape.cpp line 3764:
>>
>>> 3762: ss.print("escapes as arg to:");
>>> 3763: call->dump("", false, &ss);
>>> 3764: return ss.as_string();
>>
>> stringStream::as_string will allocate a new string on resource arena.
>> I think you should place "ResourceMark rm;" to reclaim that space.
>> ps: I don't quite understand why not all code of share/opto follow this idiom. maybe it's not an issue.
>
> There is already a `ResourceMark` in [`ConnectionGraph::do_analysis`](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/escape.cpp#L96) that catches these strings. FWIW, I tried adding another more nested `ResourceMark`, but ran into trouble since some of the GrowableArrays might then be resized in the nested mark which is a bug [(See)](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/utilities/growableArray.cpp#L64-L71).
I miss that. you are right!
-------------
PR: https://git.openjdk.java.net/jdk/pull/7428
More information about the hotspot-compiler-dev
mailing list