1 Reply Latest reply: Dec 16, 2011 12:34 AM by EJP RSS

    OutOfMemory error but application continues

    905734
      Hi,

      I have faced OutOfMemory error in my application. But the thing is my application keeps on running though it has thrown OutOfMemeory. After some two minutes later, JVM has quit and pid file got genearted throwing java.lang.OutOfMemoryError: requested 746 bytes for jbyte in /BUILD_AREA/jdk6_21/hotspot/src/share/vm/prims/jni.cpp. Out of swap space?.

      Is it possible for JVM to continue running even after throwing OutOfMemory error ?
      Also can you give me some direction to investigate on this further?


      I am pasting the excerpt from log to get a better understanding.


      1) There are two out of memory errors. One at 2011.12.09 16.04.09:446 and another at 2011.12.09 16.04.40:818

      2011.12.09 16.04.09:446 664849490 WARNING {HTTP@9800-168}RULEZ runtime exception [transcoding]
      java.lang.OutOfMemoryError
      at java.util.zip.Inflater.inflateBytes(Native Method)
      at java.util.zip.Inflater.inflate(Inflater.java:238)
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:135)
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:105)
      at java.util.jar.JarVerifier$VerifierStream.read(JarVerifier.java:428)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)
      at javax.mail.Session.loadProvidersFromStream(Session.java:932)
      at javax.mail.Session.access$000(Session.java:174)
      at javax.mail.Session$1.load(Session.java:870)
      at javax.mail.Session.loadResource(Session.java:1084)
      at javax.mail.Session.loadProviders(Session.java:889)
      at javax.mail.Session.<init>(Session.java:210)
      at javax.mail.Session.getInstance(Session.java:249)
      .
      .
      .[Application continues here]
      .
      .
      .
      2011.12.09 16.04.40:818 664882092 WARNING {HTTP@9800-168}RULEZ runtime exception [transcoding]
      java.lang.OutOfMemoryError
      at java.util.zip.Inflater.inflateBytes(Native Method)
      at java.util.zip.Inflater.inflate(Inflater.java:238)
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:135)
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:105)
      at java.util.jar.JarVerifier$VerifierStream.read(JarVerifier.java:428)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)
      at javax.mail.Session.loadProvidersFromStream(Session.java:932)
      at javax.mail.Session.access$000(Session.java:174)
      at javax.mail.Session$1.load(Session.java:870)
      at javax.mail.Session.loadResource(Session.java:1084)
      at javax.mail.Session.loadProviders(Session.java:889)
      at javax.mail.Session.<init>(Session.java:210)
      at javax.mail.Session.getInstance(Session.java:249)
      .
      .
      .
      .
      .

      2) At Dec 9 16:07,JVM quits and created pid file as below. So, there is ~2 minutes gap between OutOFMemory error log statement and for jvm to quit and create pid file.

      $ls

      -rw-rw-r-- 1 ins ins 156076 Dec 9 16:07 hs_err_pid29157.log
      -rw------- 1 ins ins 3055525888 Dec 9 16:07 core.29157


      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # java.lang.OutOfMemoryError: requested 746 bytes for jbyte in /BUILD_AREA/jdk6_21/hotspot/src/share/vm/prims/jni.cpp. Out of swap space?
      #
      # Internal Error (allocation.inline.hpp:39), pid=21129, tid=667401120
      # Error: jbyte in /BUILD_AREA/jdk6_21/hotspot/src/share/vm/prims/jni.cpp
      #
      # JRE version: 6.0_21-b06
      # Java VM: Java HotSpot(TM) Server VM (17.0-b16 mixed mode linux-x86 )
      # If you would like to submit a bug report, please visit:
      # http://java.sun.com/webapps/bugreport/crash.jsp
      #

      --------------- T H R E A D ---------------

      Current thread (0x2f929000): JavaThread "DRIVER:adapter:12:7" [_thread_in_vm, id=21834, stack(0x27c5b000,0x27c7c000)]

      Stack: [0x27c5b000,0x27c7c000], sp=0x27c7a874, free space=7e27c7c000k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x6a9262]
      V [libjvm.so+0x2b277f]
      V [libjvm.so+0x3c0b0f]
      C [libocijdbc10.so+0x108ff]
      C [libocijdbc10.so+0x11788] Java_oracle_jdbc_driver_T2CConnection_lobGetLength+0x30
      J oracle.jdbc.driver.T2CConnection.lobGetLength(J[BI)J

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      J oracle.jdbc.driver.T2CConnection.lobGetLength(J[BI)J
      J oracle.jdbc.driver.T2CConnection.length(Loracle/sql/BLOB;)J
      J com.fh.common.database.ReadConnectionImpl.getByteArray(Ljava/lang/String;Ljava/sql/ResultSet;I)[B
      J com.fh.common.database.ReadConnectionWrapper.getByteArray(Ljava/lang/String;Ljava/sql/ResultSet;I)[B
      J com.fh.mr.storage.MultiJDBCStorage.fillInitiator(Lcom/fh/common/database/ReadConnection;Ljava/lang/String;Ljava/sql/ResultSet;Lcom/fh/mr/router/TransactionResponder;)Lcom/fh/mr/router/TransactionInitiator;
      J com.fh.mr.storage.MultiJDBCStorage.addInitiators(Lcom/fh/mr/router/TransactionResponder;Ljava/util/Collection;)V
      J com.fh.mr.storage.CacheStorage.getResponderByTransactionID(Ljava/lang/String;)Lcom/fh/mr/router/TransactionResponder;
      j com.fh.mr.router.RoutingEngine.getResponderByTransactionID(Ljava/lang/String;)Lcom/fh/mr/router/TransactionResponder;+5
      j com.fh.mr.router.RoutingEngine.scheduleStatusResend(Ljava/lang/String;)Z+53
      j com.fh.mr.router.RoutingEngine.scheduleResend(Lcom/fh/mr/message/Message;I)Z+68
      j com.fh.mr.drivers.Driver.getMessage(Ljava/lang/Object;)Lcom/fh/mr/message/Message;+260
      J com.fh.mr.drivers.Driver$QueueWorker.run()V
      j com.fh.common.threadpool.ThreadControl.run()V+47
      j com.fh.common.threadpool.ThreadPool$PoolThread.run()V+467
      v ~StubRoutines::call_stub

      Thanks,
      Vijay