-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
fx2.0
-
EA build 25, Windows XP
I've noticed that if I add a tooltip to an FX control and then trigger that tooltip at runtime (by hovering over it), it induces a memory leak which in my case is quite large because of the tooltipped control's parent reference. Attached is a sample application that will hopefully demonstrate the problem if you go through the following steps:
- Run the app
- Hover over the textbox and trigger the tooltip to appear
- Click the button to remove the textbox from the scene. At this point there should be no remaining references to the textbox.
- Garbage collection (hopefully) runs
After going through this process, dump the heap and analyze it. You'll notice that the textbox is still in memory because of a reference chain similar to the one in the attached image from Eclipse MAT. This leak is potentially very serious because anything referenced by the parent of the textbox will be retained in memory. Note that if you skip the step where you hover on the control and trigger the tooltip popup, that the TextBox instance is not retained in memory.
- Run the app
- Hover over the textbox and trigger the tooltip to appear
- Click the button to remove the textbox from the scene. At this point there should be no remaining references to the textbox.
- Garbage collection (hopefully) runs
After going through this process, dump the heap and analyze it. You'll notice that the textbox is still in memory because of a reference chain similar to the one in the attached image from Eclipse MAT. This leak is potentially very serious because anything referenced by the parent of the textbox will be retained in memory. Note that if you skip the step where you hover on the control and trigger the tooltip popup, that the TextBox instance is not retained in memory.
- relates to
-
JDK-8240642 Memory Leak in Tooltip if content changes while tooltip closed
- Open