Forum Stats

  • 3,827,131 Users
  • 2,260,743 Discussions


Slowing down the JavaFX application while drawing charts for a long time

User_899LL Member Posts: 3 Green Ribbon

I have written the JavaFX 1.8 application (I have to use this Java version) which draws several charts in different tabs in the real time. Data for each charts are receiving periodically and there are about 2 samples per second for all the charts. One chart stores 2000 samples and 4 other charts about 500 samples. Older samples are removing from the charts.

When the application is working for about 2 hours then the CPU load increases to the 100% and the application slows down a lot and there it is not possible to interact with GUI. When I reduce the number of samples to 100 per chart then there is no problem with slowing down the application.

In the code I set setAnimated and setCreateSymbols to false. For adding new samples to the charts I'm using the

getData().add(new XYChart.Data("TIMESTAMP", value))

I also checked that there is always using Platform.runLater command. When I make the simulation in which the same data are received in the shorter time then the the slowdown of the application appears faster.

Could someone help me how to resolve problem with slowing down the application?

Best regards,