Using a css in javafx is causing a huge memory usa

2020-04-16 19:03发布

问题:

I have followed ensemble sample of javafx and tried to create a candle stick chart.

It loads a css file ensemble2.css using this line of code

getStylesheets().add((CandleStickChart.class.getResource(
                    "ensemble2.css")
                    .toExternalForm()));

but when I profile my application (which is adding one candle every 100 ms ) it is using around 2 GigaBits of memory but when I removed CSS it is using only half this memory.

What could be possible reason and how can it be improved.

Thanks