posted 20 years ago
Hi all,
In a fairly large Swing applications, lots of Swing objects gets created and destroyed. Let's assume there is a form in an application that has about 300 widgets (including JTabbedPane, JTextField, JLabel, JButton, ...). Each time this form gets created in the application, we have to create all these widgets. Although when we dispose the JFrame holding these widgets, theoretically they become available for the garbage collector to clean up, we want to make sure they get cleaned up as fast as possible (as this could harm the performance of our application if they stay around too much). If I am right, we can call the System.gc(), but even this call does not force the garbage collector to run at that time. Is this correct?
Any thoughts on how to improve performance in this scenario?
Thank you,
Payam.