JDK-6830986 : JRE 5.0 quickly receives OutOfMemoryError in ZipFile.open
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 5.0u17
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2009-04-16
  • Updated: 2011-05-20
  • Resolved: 2010-03-11
Related Reports
Duplicate :  
Relates :  
Description
JRE 5.0 Update 17 encounters quickly java.lang.OutOfMemoryError,
when opening zip files in a loop.

The issue is quite easily reproducible on JRE 5.0 by running the following
testcase.

1. Testcase
-----------
The testcase consists of the following files:

  3462 Apr 15 09:59 ZipFileRepeatOOM.java
139659 Apr 15 09:59 longEntries.zip

The zip file "longEntries.zip" is opened over and over after renaming it in 
every iteration.

2. Compile
----------
/jdk1.5.0_17/bin/javac ZipFileRepeatOOM.java

3. Run
------
3.1 Client VM
-------------
% mv longEntries.zip_<nn> longEntries.zip
% /jdk1.5.0_17/bin/java -client -Xms64m -Xmx64m -XX:MaxPermSize=32m -DresultCount=0 ZipFileRepeatOOM longEntries.zip
Set input file specification to "longEntries.zip"
1
[ ... ]
30668
30669
30670
30671
30672
Exception in thread "main" java.lang.OutOfMemoryError
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:203)
        at java.util.zip.ZipFile.<init>(ZipFile.java:84)
        at ZipFileRepeatOOM.reproduceOOM(ZipFileRepeatOOM.java:44)
        at ZipFileRepeatOOM.main(ZipFileRepeatOOM.java:112)
%

3.2 Server VM
-------------
% mv longEntries.zip_<nn> longEntries.zip
% /jdk1.5.0_17/bin/java -server -Xms64m -Xmx64m -XX:MaxPermSize=32m -DresultCount=0 ZipFileRepeatOOM longEntries.zip
Set input file specification to "longEntries.zip"
1
[ ... ]
61362
61363
61364
61365
Exception in thread "main" java.lang.OutOfMemoryError
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:203)
        at java.util.zip.ZipFile.<init>(ZipFile.java:84)
        at ZipFileRepeatOOM.reproduceOOM(ZipFileRepeatOOM.java:44)
        at ZipFileRepeatOOM.main(ZipFileRepeatOOM.java:112)
%

Comments
EVALUATION Need to backport 6280693. (along with some other fixes potentially) This might be a good opportunity to basically sync the rarely changing zip code between 5 & 6. (since after 6280693 there'll be very little difference in any case)
15-10-2009

EVALUATION Given the availablility of a workaround I'm having a hard time seeing this as a high priority issue. I'm lowering it to P3. When/if the cu escalates we can revisit that.
21-04-2009

EVALUATION This may be a duplicate of 6830986, in which case this bug should be closed and 6830986 escalated.
16-04-2009