RFR: 8281548: Add escape analysis tracing flag [v4]
Jorn Vernee
jvernee at openjdk.java.net
Tue Feb 15 21:14:13 UTC 2022
On Tue, 15 Feb 2022 20:59:22 GMT, Xin Liu <xliu at openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Review comments
>
> 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`](1) that catches these strings. FWIW adding another more nested `ResourceMark` is not possible since some of the GrowableArrays might then be resized in the nested mark which is a bug [(See)](2).
[1]: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/escape.cpp#L96
[2]: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/utilities/growableArray.cpp#L64-L71
-------------
PR: https://git.openjdk.java.net/jdk/pull/7428
More information about the hotspot-compiler-dev
mailing list