SUN.ZIP.DISABLEMEMORYMAPPING__ Open Source Project (open

Source: Internet
Author: User

Sometimes you can cause JVM crash If you modify the jar file that the JVM is load. The stacktrace occurs when the Java.util.zip.ZipFile.getEntry ().

There are three possible scenarios here:
1. While a class was in the use it is dynamically reloaded from a jar file.
2. While a jar file is being accessed by the class loader, the jar file is being modified.
3. A Jarfile which was bigger than 4GB is accessed (applies to Java 6 and earlier only)


The solution is to make sure that the jar file is not updated or modified by other programs while the JVM is loading the jar file. The JVM then introduced a new property sun.zip.disableMemoryMapping, if the JVM was started with parameter-dsun.zip.disablememorymapping=true, The JVM then does not crash when it encounters this situation.


Of course, this property cannot be overly dependent, because the jar file being updated when it is load may cause the program to perform an exception and make it more prone to problems such as bugs.

Original: http://blog.csdn.net/hongchangfirst/article/details/78950369

Author: Hongchangfirst

Hongchangfirst's homepage: http://blog.csdn.net/hongchangfirst

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.