Confluence : java.util.zip.ZipFile.open causes OutOfMemoryError for large zip files
This page last changed on Nov 29, 2006 by ivan@atlassian.com.
ProblemFor large backup zip files (bigger than 1GB) OutOfMemoryErrors can occur during restore, even though the maximum heap size is way above this value. The error will look something like this: Cause: javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:275) caused by: java.lang.OutOfMemoryError at java.util.zip.ZipFile.open(Native Method) However, when looking at the system information you will find that there is still a lot of memory available on the heap. Memory Information: Total Memory: 2480 MB Free Memory: 2385 MB Used Memory: 95 MB SolutionThe problem seems to be a bug in Java. The method java.util.zip.ZipFile.open does not actually use the allocated memory of the heap, it maps the entire zip file into virtual memory outside the heap. If you run into this problem, you should try to reduce your heap size to about 600MB and try the restore again. This seems to accord with the experience of other developers:
Related topics |
![]() |
Document generated by Confluence on May 01, 2007 19:28 |