posted 20 years ago
Hi,
I have one method which is called 4000 times (say).
I am getting OutOfMemoryException on calling the method for 4000 times.
Is there any error in my method .
Is there any way to take care of OutOfMemoryException in my method??
Please suggest.
My method is as follows.
protected void replaceSpecificComboBoxEditor(List l, int row, int column)
{
DefaultCellEditor editor = new DefaultCellEditor
(new JComboBox(l.toArray()));
removeCellEditor(row, column);
addCellEditor(row, column, editor);
}
I have also tried the following .Still the problem is coming .
protected void replaceSpecificComboBoxEditor(List l, int row, int column)
{
DefaultCellEditor editor = new DefaultCellEditor
(new JComboBox(l.toArray()));
removeCellEditor(row, column);
addCellEditor(row, column, editor);
//added the following lines.
editor = null;
System.gc();
}
Is there any way to force the garbage collector to collect unused object references ?
TIA for the suggestions.
Raj