BUG: TreeView setPrefHeight CSS freakout

Ty Young youngty1997 at gmail.com
Sat Jun 15 02:05:18 UTC 2019

Attempting to set the preferred height of a TreeView or content that 
would otherwise expand the component(super.setPrefHeight or another 
component in the containing node) results in a massive freakout 
resulting in a memory leak and extremely high CPU usage.

Using Netbean's method profiler[1] shows that 
VirtualFlow.addTrailingCells is taking 130 seconds. Going down a leaf 
shows that Node.applyCss and Node.processCss are taking up the 
majority(all? Numbers aren't adding up.) of the time and presumably 
causing the memory leak and high CPU usage.

Even after removing any custom CSS stylesheets this still happens. This 
only seems to affect TreeView as well as no other component(maybe 
ListView since they are similar?) has this issue.

Maybe related is a CSS bug where an in-between state between a scrollbar 
showing in the TreeView and when there is not. In this state, a visible 
white space can be seen at the bottom where the scrollbar was(although 
the white space is smaller). If you are using the default JavaFX CSS 
stylesheet you won't see this as the background color is white. Clicking 
a TreeView item seems to update the TreeView and fix this white space 
issue. ScrollPane and ScrollBars are really broken in JavaFX in general 
under Linux so its hard to say whether or not it is related.

Any ideas on what's causing all this?

[1] https://imgur.com/a/DT3eiNj

More information about the openjfx-dev mailing list