Question re -XX:-FlightRecorder
Erik Gahlin
erik.gahlin at oracle.com
Tue Oct 6 15:32:58 UTC 2020
Hi Andrey,
The flag is legacy from JDK 7 when we needed -XX:+FlightRecorder to allocate global buffers when the VM started. That restriction was removed in 8u40. it is probably a good idea to remove the flag completely. The method JfrRecorder::is_disabled() should be removed at the same time.
When it comes to earlier releases, I think we need to stick to the behaviour that exists. Changing it in an update release would cause even more confusion.
Do you know why users want to use -XX:-FlightRecorder?
Thanks
Erik
> On 6 Oct 2020, at 11:44, Andrey Petushkov <andrey.petushkov at gmail.com> wrote:
>
> Hi Erik, All,
>
> sometimes ([1], [2]) the message is given that the command line switch
> -XX:-FlightRecorder disables the JFR functionality. The problem is
> that this statement is not true and in fact causes buggy behavior of
> the VM. Namely:
> - on a release VM ran with -XX:-FlightRecorder the call to
> FlightRecorder.getFlightRecorder() succeeds and the recording can be
> successfully created (much like as if no command line flag was given)
> - on a debug version of VM ran with same flag the call to
> FlightRecorder.getFlightRecorder() crashes the VM on assert
> # Internal Error
> (/home/andrey/ws/jdk/src/hotspot/share/jfr/recorder/jfrRecorder.cpp:236),
> pid=331136, tid=331137
> # assert(!is_disabled()) failed: invariant
>
> It would be good to clarify the behavior and implement it in the
> consistent way, that is, either:
> - allow -XX:-FlightRecorder to actually disable JFR forever, and throw
> IllegalStateException from FlightRecorder.getFlightRecorder() and
> friends
> - declare -XX:-FlightRecorder as no-op and remove the mentioned assert
> Please note that the answer might be different for pre-13 and 13+
> versions because of flag deprecation
>
> Any opinion on this?
> This might not look like an important thing at all however there were
> quite a number of users (Azul customers) stumbling on unclear behavior
> of the said flag so I thought it's better to have this fixed
>
> Thanks a lot,
> Andrey
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8225312
> [2] jdk/src/hotspot/share/jfr/recorder/jfrRecorder.cpp,
> JfrRecorder::is_disabled()
More information about the hotspot-jfr-dev
mailing list