File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes About Sun JVM Bug 4705373 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "About Sun JVM Bug 4705373" Watch "About Sun JVM Bug 4705373" New topic

About Sun JVM Bug 4705373

NaChuan Chen

Joined: Jul 11, 2005
Posts: 2
For the detail description of this bug, please refer to
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 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[0]).length() + " bytes");
} catch (Throwable t) {

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

I didnot get the OutOfMemoryError.

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

Joined: Jul 08, 2003
Posts: 24195


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.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: About Sun JVM Bug 4705373
It's not a secret anymore!