Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8360597

MediaPlayer: Idle Wake Ups 200-400ms. Hundreds and thousands of threads running?

XMLWordPrintable

    • x86_64
    • os_x

      ADDITIONAL SYSTEM INFORMATION :
      Environment: MacOS 11.7.10, Java JDK 24, javafx versions 21,24,25, Apache NetBeans IDE 25

      A DESCRIPTION OF THE PROBLEM :
      - High Idle Wake Ups 200-400ms in MAC OS Activity Monitor.
      - Hundreds and thousands of threads running while debugging javafx MediaPlayer application in Netbeans.
      - Many threads remain running in Netbeans debugger after the media player is stopped, some threads die.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      - Run any demo code that uses javafx MediaPlayer and watch Idle Wake Ups in MAC OS Activity Monitor.
      - Debug that code in Netbeans and see hundreds or thousands Running threads.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Idle Wake Ups should not exceed 40-60. High number indicates that JMV is switching between a big number of threads.
      ACTUAL -
      - Idle Wake Ups 200-400ms in MAC OS Activity Monitor.
      - Hundreds or thousands Running threads in Netbeans debugger, which makes debugger unusable.

      ---------- BEGIN SOURCE ----------
      public class MediaExample extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          public void start(Stage primaryStage) throws MalformedURLException {
              File mediaFile = new File("assets/media/Golden-48569.mp4");
              Media media = new Media(mediaFile.toURI().toURL().toString());

              MediaPlayer mediaPlayer = new MediaPlayer(media);

              MediaView mediaView = new MediaView(mediaPlayer);

              Scene scene = new Scene(new Pane(mediaView), 1024, 800);
              primaryStage.setScene(scene);
              primaryStage.show();

              mediaPlayer.play();
          }
      }
      ---------- END SOURCE ----------

            almatvee Alexander Matveev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: