JDK-6396844 : JFileChooser seems to cause OutOfMemory in 1.4.2, 5.0u4 and mustang-b75
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0,6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-03-10
  • Updated: 2011-01-19
  • Resolved: 2006-08-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
1.4.2_15Fixed 6 b94Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
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
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.
22-09-2006

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

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

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