• Post Reply Bookmark Topic Watch Topic
  • New Topic

unzip problem, I give up now  RSS feed

 
benny rusli
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone, every expert people,
now I am giving up with java.util.zip : I think, i should use another package library to zip and unzip a big Files between 10-400 GB. Here my code to unzip a 25 GB Files, with the following error :
Any help will be appreciated, thanks very much.

java.util.zip.ZipException : zip file too large
at java.util.zip.ZipFile.open<Native Method>
at java.util.zip.ZipFile.<init><ZipFile.java:204>
at UnzipExample.main<UnzipExample.java:31>

 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried increasing the memory when you start up java? it's the -Xms option.

So to make it 128 megs, for example: -Xms128m
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a known bug in the implementation of ZipFile on some platforms. ZipFile uses nio to mmap() the whole file into RAM. Of course, if the file is larger than virtual memory, this isn't going to work!

As a result, ZipFile is useful only on small zip files. Instead, use ZipInputStream -- believe it or not, it doesn't suffer the same implementation issues, and works fine on any size file.
 
benny rusli
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks people, i will try it now with increasing the virtual machine memory and use ZipInputStream
 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The MUCH better thing to do is use ZipInputStream and NOT change the memory with the -X option, since the -X is non-standard and not supported by all VMs.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!