Huge memory consumption when loading a large Image

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P2
    • None
    • Affects Version/s: 8u40
    • Component/s: javafx
    • Environment:

      Windows 7

      Run this sample test program :

      "
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.image.Image;
      import javafx.scene.image.ImageView;
      import javafx.scene.layout.GridPane;
      import javafx.stage.Stage;

      public class HugeMemoryTest extends Application {

          @Override
          public void start(Stage primaryStage) {
              GridPane gridPane = new GridPane();
              ImageView imageView = new ImageView(new Image("chart.png"));
              gridPane.add(imageView, 0, 0);
              Scene scen = new Scene(gridPane);
              primaryStage.setScene(scen);
              primaryStage.show();
          }

          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              launch(args);
          }

      }"

      You will need this image http://i.imgur.com/N7yWVTV.png which is 5000x5000 but only weight 483ko.

      Run the program and you will see that your JRE is using nearly 100Mb for displaying one single Image. The blame is on HeapByteBuffer.

      I think it may be similar to RT-39386 but unsure. This is a serious issue.

            Assignee:
            Kevin Rushforth
            Reporter:
            Samir Hadzic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: