Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-236711

Starting and stopping JFR profiling multiple times within the same minute overwrites previous JFR results saved during that minute

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 21w38a
    • 21w37a
    • None
    • Confirmed
    • Debug, Performance
    • Normal

      The bug

      Starting and stopping JFR profiling multiple times within the same minute overwrites previous JFR results saved during the same minute. Basically, only the report saved most recently is saved, and the older ones saved during the same minute are overwritten by the newest one.

      How to reproduce

      1. Make sure you have enough time to run four commands before the next minute on your computer's clock
      2. Run the command /jfr start
      3. Run the command /jfr stop
      4. Run /jfr start and /jfr stop again
      5. Navigate to your Minecraft folder -> debug
        Notice that only one JFR report (one .jfr and one .txt) was saved

      Expected results

      It would be expected that all reports are saved, even if multiple reports are saved within the same minute. This could be done by appending "-2", "-3", etc. to the end of the file name if a file already exists in the location Minecraft is trying to save the report.

            billy.sjoberg [Mojang] Billy Sjöberg
            markderickson [Mod] markderickson
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: