How to dispose a tabbed pane component completely from a JTabbedPane
问题 I have added a few tabs to a JTabbedPane. Each tab contains a JPanel. I now remove the tab by calling JTabbedPane.remove([tab index]). This removes the tab and everything is fine, except that when I profile the app, the JPanel added to the JTabbedPane does not get 'disposed' off and the reference is still present in the heap. After few 100 operations of adding the tab and closing it, the app goes Out of Memory. I analysed the heap dump using Eclipse MAT and I clicked on the Immediate