File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About Sun JVM Bug 4705373

 
NaChuan Chen
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the detail description of this bug, please refer to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4705373
I made a test on Bug 4705373 on my laptop, the test environment is:
RAM: 1.25GB
OS: Windows XP SP1
JAVA: Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
The size of test2.zip: 1.32GB
Test program:
public class LargeZipFile {
public static void main(String[] args) {
try {
System.out.println("totoal memory: " + Runtime.getRuntime().totalMemory());
System.out.println("free memory: " + Runtime.getRuntime().freeMemory());
System.out.println(args[0] + ", size is " + new java.io.File(args[0]).length() + " bytes");
new java.util.zip.ZipFile(args[0]);
System.out.println("success");
} catch (Throwable t) {
t.printStackTrace();
}
}
}

Test Result:
E:\Tools>java -Xms1250m -Xmx1250m LargeZipFile test2.zip
totoal memory: 1300692992
free memory: 1300560136
test2.zip, size is 1425952261 bytes
success

I didnot get the OutOfMemoryError.

Questions:
1. Is this bug only related with Linux system (Or certain kernel version)?
2. How to reproduce this bug on Windows environment?
3. Can anybody give a more detailed explaination of the cause of the bug?

Thanks a lot!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

It's a bug in Sun's implementation of this class on Linux. The bug doesn't apply on other platforms. The bug is in the native code, which is obviously completely different on Windows.

The workaround, by the way, is to not use ZipFile; instead use ZipInputStream directly. It's only ZipFile that has the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic