JFR files are generated in /tmp filling up space despite configured limitations

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: 17, 21, 25
    • Component/s: hotspot
    • jfr
    • generic
    • generic

      JFR files are being generated in /tmp and filling up disk space despite configured size limitations. It seems that setMaxSize() is being ignored, possibly because the system is overloaded.

      On my system, running the test below produced JFR files of the following sizes(it grows slooowly):
       - 95,984,956 bytes
       - 260,490,687 bytes

      This behavior indicates that the configured size limits are not being enforced consistently, which can lead to unexpected disk usage.

      Steps to reproduce on JDK 17, 21 and 25:

          static {
              System.setProperty("java.io.tmpdir", "/tmp/serb");
          }

          public static void main(String[] args) throws InterruptedException {
              RecordingStream stream = new RecordingStream();
              stream.setMaxSize(150_000);
              stream.startAsync();
              Runtime.getRuntime().addShutdownHook(new Thread(stream::close));
              while (true) {
                  Thread start = null;
                  for (int i = 0; i < 100; i++) {
                      // for 21+
                      // Thread.Builder.OfVirtual ofVirtual = Thread.ofVirtual();
                      // start = ofVirtual.start(() -> {});
                  
                      // for 17
                      start = new Thread(() -> {});
                      start.start();
                  }
                  start.join();
              }
          }
      // the code is a bit unusual, I migrated it from a real reproducer/use case.

            Assignee:
            Kerem Kat
            Reporter:
            Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: