Java progress of simple JavaFX application with ProgressBar or ProgressIndicator which progress set to -1 (INDETERMINATE_PROGRESS) gradually uses more and more memory until it fills both ram and swap in just a few minutes.
I'm using Fedora 23 x86_64 with latest updates, kernel-4.4.5-300.fc23.x86_64 and jdk1.8.0_74. The same problem occurs with kernel-4.2.3-300.fc23.x86_64 and both jdk1.8.0_73 and jdk1.8.0_45.
I'm facing this problem in my project and it's occuring even in the simplest application:
package sample;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ProgressIndicator;
import javafx.stage.Stage;
public class ProgressBarMemoryLeak extends Application {
ProgressIndicator progress = new ProgressIndicator(-1);
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setScene(new Scene(progress, 100, 100));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Is there any way to overcome this problem?
Maybe there is some other custom ProgressBar implementation i can use instead?