Java OUTOFMEMORY exception: MMAP error loading zip file
I run my application to produce env (RHEL 5.2 x64, Oracle JRE 1.7_05, Tomcat 7.0.28) and JVM parameters:
-Xms8192m -Xmx8192m -XX:MaxPermSize=1024m -Doracle.net.tns_admin=/var/ora_net -XX:ReservedCodeCacheSize=512m -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:+OptimizeStringConcat -XX:+UseCompressedOops -XX:+UseG1GC -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9026 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
After a few times, I have a stack trace:
Java HotSpot(TM) 64-Bit Server VM warning: Attempt to deallocate stack guard pages Failed. Java HotSpot(TM) 64-Bit Server VM warning: Attempt to allocate stack guard pages Failed. mmap Failed for CEN and END part of zip file [...] Caused by: java.lang.OutOfMemoryError: null at java.util.zip.ZipFile.$$YJP$$open(Native Method) ~[na:1.7.0_05] at java.util.zip.ZipFile.open(UnkNown Source) ~[na:1.7.0_05] at java.util.zip.ZipFile.<init>(UnkNown Source) ~[na:1.7.0_05] at java.util.zip.ZipFile.<init>(UnkNown Source) ~[na:1.7.0_05] at java.util.jar.JarFile.<init>(UnkNown Source) ~[na:1.7.0_05] at java.util.jar.JarFile.<init>(UnkNown Source) ~[na:1.7.0_05] at sun.net.www.protocol.jar.URLJarFile.<init>(UnkNown Source) ~[na:1.7.0_05] at sun.net.www.protocol.jar.URLJarFile.getJarFile(UnkNown Source) ~[na:1.7.0_05] at sun.net.www.protocol.jar.JarFileFactory.get(UnkNown Source) ~[na:1.7.0_05] at sun.net.www.protocol.jar.JarURLConnection.connect(UnkNown Source) ~[na:1.7.0_05] at sun.net.www.protocol.jar.JarURLConnection.getInputStream(UnkNown Source) ~[na:1.7.0_05] at java.net.URL.openStream(UnkNown Source) ~[na:1.7.0_05] at org.apache.catalina.loader.WebappClassLoader.findLoadedResource(WebappClassLoader.java:3279) ~[na:na] at org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1478) ~[na:na] at org.apache.http.util.VersionInfo.loadVersionInfo(VersionInfo.java:242) ~[httpcore-4.2.jar:4.2] at org.apache.http.impl.client.DefaultHttpClient.setDefaultHttpParams(DefaultHttpClient.java:180) ~[httpclient-4.2.jar:4.2] at org.apache.http.impl.client.DefaultHttpClient.createHttpParams(DefaultHttpClient.java:158) ~[httpclient-4.2.jar:4.2] at org.apache.http.impl.client.AbstractHttpClient.getParams(AbstractHttpClient.java:448) ~[httpclient-4.2.jar:4.2]
Look at my Analyzer - everything is fine (heap and non heap memory is used for 10%), I don't know what the problem is
This problem occurs at the same time every day. It is not connected to the normal running time of the application What is the reason?
Edit:
New output in log file:
Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled. Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize= Code Cache [0x00002aaaab790000,0x00002aaaad240000,0x00002aaacb790000) total_blobs=4223 nmethods=3457 adapters=707 free_code_cache=497085Kb largest_free_block=508887936
But I have enough memory: http://i.stack.imgur.com/K8VMx.jpg
Answer: the questions in the Java version are described here: https://forums.oracle.com/forums/thread.jspa?messageID=10369413
Solution
I have seen these errors before when running resources, such as running swap space or running allowed memory mapping Look at sudo cat / proc / $PID / maps | WC - L and cat / proc / sys / VM / max_ map_ Count for comparison
See comments below
I also suggest
You seem to have encountered a bug with your kit What version do you use?
I will cut most of the options because they are default, do nothing or may complicate things
-mx8g -XX:MaxPermSize=1g -Doracle.net.tns_admin=/var/ora_net -XX:ReservedCodeCacheSize=512m -XX:+UseG1GC -Dcom.sun.management.jmxremote.port=9026
I will try to give up - XX: useg1gc and this is a relatively new collector and should not change your results