<Swing Dev> RFR 6542439:Significant memory leak in BasicComboBoxUI and MetalComboBoxButton

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Sat Aug 22 02:57:31 UTC 2020


Looks fine.

On 20.08.2020 06:54, Prasanta Sadhukhan wrote:
> Hi All,
> 
> Please review a fix for an memory leak issue whereby the BasicComboBoxUI uses a CellRenderer pane to paint the renderer component
> retrieved via getListCellRenderer from the JList instance. CellRendererPane paint the component but it never removes it from its component hierarchy.
> JCombobox can produce dynamic renderer component instances in getListCellRenderer method. Each one of these instances
> will linger in memory because it remains in the component hierarchy of the CellRendererPane resulting in memory leak.
> 
> This is solved for JList in JDK-5044798 <https://bugs.openjdk.java.net/browse/JDK-5044798>.
> 
> The fix is now extended for BasicComboBoxUI where removeAll() of components is done after all painting is done.
> 
> The JDK-5044798 <https://bugs.openjdk.java.net/browse/JDK-5044798> regression testcase is used for JComboBox with all L&Fs and other *ComboBoxUIs are fixed similarly.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-6542439
> 
> webrev: http://cr.openjdk.java.net/~psadhukhan/6542439/webrev.0/
> 
> Regards
> Prasanta


-- 
Best regards, Sergey.


More information about the swing-dev mailing list