United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6396844 : JFileChooser seems to cause OutOfMemory in 1.4.2, 5.0u4 and mustang-b75

Details
Type:
Bug
Submit Date:
2006-03-10
Status:
Resolved
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2006-08-02
Component:
client-libs
OS:
windows_xp
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0,6
Fixed Versions:

Related Reports
Backport:
Backport:
Duplicate:
Relates:
Relates:
Relates:

Sub Tasks

Description
JFileChooser seems to cause OutOfMemory.

CONFIGURATION:
 -OS  : winXP(SP2,Japanese)
 -JRE : 1.4.2_11, 5.0u4, mustangb75

REPRODUCE:
 1) Compile the attached test program, JFileChooserTest.java
 2) Launch 
       java -Xmx8m -verbose:gc JFileChooserTest > log 2>&1

 3) A dialogue appears, 
    if you use 1.4.2_XX, please click go button.
    if 5.0ux, please set 200 to text box of "repeat count" 
   Then Click "Go" BUtton.

 4) when the program stopped, please refer to log file.
    OutOfMemory message appears.
  

NOTE:
  - -Xmx8m is specified to reproduce quickly.
     Actual licnesee program does not set such small heap size.
  - When we use JFileChose, updateUI() might not be applied.
    This is speficied to show the possibility of some leak in JFIleChooser.
    That's specified  only for quick reproduction.

                                    

Comments
EVALUATION

Original synopsis said "JColorChooser seems to...". The test and description, however, are about JFileChooser. So I've changed the synopsis.
                                     
2006-03-10
EVALUATION

Looks like a memory leak in JFileChooser. The attached test application should be profiled to found which objects remain in memory.
                                     
2006-03-13
EVALUATION

This is not memory leak, but massive usage of resources. We should minimize them.
                                     
2006-07-19
WORK AROUND

In the testcase remove the JFileChooser from it's parent.
CHOOSER.getParent().remove(CHOOSER);

Add this line before the doAttempt() function is finishing.
                                     
2006-09-22



Hardware and Software, Engineered to Work Together