-
Bug
-
Resolution: Unresolved
-
P4
-
8u91
-
x86_64
-
linux
FULL PRODUCT VERSION :
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux archlinux 4.5.1-1-ARCH #1 SMP PREEMPT Thu Apr 14 19:19:32 CEST 2016 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Running the provided source code causes a memory leak.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code and the system memory will slowly get depleted.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package javafxtest;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.geometry.Point2D;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
public class Main extends Application {
private Point2D mousePosition = new Point2D(1,0);
@Override
public void start(Stage primaryStage) throws Exception {
Circle c = new Circle(30);
c.setFill(Color.RED);
c.setTranslateX(100);
c.setTranslateY(100);
Pane root = new Pane();
root.getChildren().addAll(c);
Scene scene = new Scene(root);
root.setOnMouseMoved(event -> {
mousePosition = new Point2D(event.getX(), event.getY());
});
AnimationTimer at = new AnimationTimer() {
@Override
public void handle(long now) {
Point2D playerPos = new Point2D(c.getTranslateX(), c.getTranslateY());
Point2D speed = playerPos.add(mousePosition.multiply(-1)).normalize();
c.setTranslateX(playerPos.getX()- speed.getX()/10);
c.setTranslateY(playerPos.getY()- speed.getY()/10);
}
};
at.start();
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux archlinux 4.5.1-1-ARCH #1 SMP PREEMPT Thu Apr 14 19:19:32 CEST 2016 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Running the provided source code causes a memory leak.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code and the system memory will slowly get depleted.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package javafxtest;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.geometry.Point2D;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
public class Main extends Application {
private Point2D mousePosition = new Point2D(1,0);
@Override
public void start(Stage primaryStage) throws Exception {
Circle c = new Circle(30);
c.setFill(Color.RED);
c.setTranslateX(100);
c.setTranslateY(100);
Pane root = new Pane();
root.getChildren().addAll(c);
Scene scene = new Scene(root);
root.setOnMouseMoved(event -> {
mousePosition = new Point2D(event.getX(), event.getY());
});
AnimationTimer at = new AnimationTimer() {
@Override
public void handle(long now) {
Point2D playerPos = new Point2D(c.getTranslateX(), c.getTranslateY());
Point2D speed = playerPos.add(mousePosition.multiply(-1)).normalize();
c.setTranslateX(playerPos.getX()- speed.getX()/10);
c.setTranslateY(playerPos.getY()- speed.getY()/10);
}
};
at.start();
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
- relates to
-
JDK-8161914 XOrg Resource Leak under Linux when running a JavaFx application
- Open
-
JDK-8188094 Memory leak running JavaFX on Linux observed using jmalloc
- Open
-
JDK-8237603 javafx memory leak under linux when use AnimationTimer
- Open
-
JDK-8161911 [Linux] Memory leak when using indefinite transitions on Label
- Closed
-
JDK-8168832 javafx consumes all system memory - memory leak
- Closed