[External] : Re: ReplayCompiles as non-develop switch ?
Vladimir Kozlov
vladimir.kozlov at oracle.com
Fri Aug 19 23:26:09 UTC 2022
I agree that it is useful.
Thanks,
Vladimir K
On 8/18/22 6:22 PM, dean.long at oracle.com wrote:
> This does sounds like a useful feature. I was surprised to find out while investigating JDK-8291665 that compiler node
> limits don't seem to be enforced in product builds.
>
> dl
>
> On 8/18/22 2:43 AM, Thomas Stüfe wrote:
>> (offlist)
>>
>> Just wanted your opinion on something.
>>
>> I prepared https://github.com/openjdk/jdk/pull/9891 <https://github.com/openjdk/jdk/pull/9891>, which adds NMT malloc
>> limits (VM will fatal out if more than x was allocated), and these limits can also be category-specific. That way one
>> could call the VM with -XX:MallocLimit=compiler:250M and if the compiler malloc load - which is typically mostly Arena
>> - hits 250M we get a fatal error and a replay file. Note it won't count code heap since that is mmap.
>>
>> I originally did this to simplify analysis in situations like https://bugs.openjdk.org/browse/JDK-8291665
>> <https://bugs.openjdk.org/browse/JDK-8291665>, where we have a release VM and the compiler arena balloons. But we also
>> could use this for other things.
>>
>> 1) for automatic memory bounds checks on all compiler jtreg tests. If we can agree on what a reasonable upper ceiling
>> would be for Compiler malloc usage, then we could set this limit for all tests wholesale. If we have a case where a
>> compiler test uses too much memory, we now get a test error. Of course, in cases where a compiler loop causes an
>> unbound memory raise we get a test error today too, just faster and possibly without OOM kill.
>>
>> 2) We also could use it as replacement of the -XX:CiCrashAt mechanism, at least in parts of the tests: set compile
>> arena very low and start compiler, you get an assert and a replay file.
>>
>> What do you think, is this worthwhile? (especially (1))
>>
>> Cheers, Thomas
>>
>>
>> On Wed, Aug 17, 2022 at 8:04 PM Vladimir Kozlov <vladimir.kozlov at oracle.com <mailto:vladimir.kozlov at oracle.com>> wrote:
>>
>> On 8/16/22 9:01 PM, Thomas Stüfe wrote:
>> > On Tue, Aug 16, 2022 at 9:00 PM Vladimir Kozlov
>> <vladimir.kozlov at oracle.com <mailto:vladimir.kozlov at oracle.com>
>> <mailto:vladimir.kozlov at oracle.com
>> <mailto:vladimir.kozlov at oracle.com>>> wrote:
>> >
>> > On 8/16/22 10:05 AM, Thomas Stüfe wrote:
>> > > Hi,
>> > >
>> > > Is there a particular reason why ReplayCompiles needs to
>> be a develop switch? Or was it just not considered useful
>> > > without asserts?
>> >
>> > It replays compilation which we want to debug in debug VM.
>> Why do you want it be `product` flag?
>> >
>> > We have DumpReplayDataOnError product flag to dump compiler
>> replay data from product VM:
>> >
>> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/compiler_globals.hpp#L331
>> <https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/compiler_globals.hpp#L331>
>> >
>> <https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/compiler_globals.hpp*L331__;Iw!!ACWV5N9M2RV99hQ!JRgjhoZKOMvpjeekz0FN5_oc8OR6PZp-lDqLr7W_AEpu5wV0xtVtbCvvgD_XWCIeoqN88QPk0i9nNBU6w2OexzZiW4G-$
>> <https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/compiler_globals.hpp*L331__;Iw!!ACWV5N9M2RV99hQ!JRgjhoZKOMvpjeekz0FN5_oc8OR6PZp-lDqLr7W_AEpu5wV0xtVtbCvvgD_XWCIeoqN88QPk0i9nNBU6w2OexzZiW4G-$>>
>>
>> >
>> >
>> > Hi Vladimir,
>> >
>> > to reproduce a compiler error in a release VM.
>> >
>> > - to experiment what its effect is on a VM that was actually
>> shipped to customers, without using a debug VM and
>> > switching tens of asserts off. E.g., in the case of
>> https://bugs.openjdk.org/browse/JDK-8291665
>> <https://bugs.openjdk.org/browse/JDK-8291665>
>> > <https://bugs.openjdk.org/browse/JDK-8291665
>> <https://bugs.openjdk.org/browse/JDK-8291665>>, how steep and how
>> quickly RSS raises, and whether the raise limits itself
>> > or is infinite.
>> > - to see whether a certain build of a shipped VM is actually
>> affected by a certain bug. Not every bug surfaces in every
>> > build.
>> >
>> > None of that are very hard reasons, and these situations are
>> rare. But they do occur, and it would be a bit more
>> > convenient to have this switch.
>>
>> So you want it for verification purpose and not for debugging an
>> issue. We did not consider it when implemented.
>> I agree it could be useful and it is not hard to convert
>> ReplayCompiles to diagnostic flag.
>> It will increase VM size but not much.
>>
>> File RFE.
>>
>> Thanks,
>> Vladimir K
>>
>> >
>> > Cheers, Thomas
>> >
>> >
>>
More information about the hotspot-compiler-dev
mailing list