Out of Memory

I am seeing out of memory in our application. Generated hprof is out around 9GB whereas Max heap size is 20 GB. In yourkit thread dump I could see following stack trace

replicationQueue-thread--p4-t1 tid=98 [RUNNABLE] [DAEMON] <--- OutOfMemoryError happened in this thread java.lang.OutOfMemoryError.() OutOfMemoryError.java:48 org.infinispan.commons.io.ExposedByteArrayOutputStream.write(byte[], int, int) ExposedByteArrayOutputStream.java:71

and in memory I could see one instance of ExposedByteArrayOutputStream is taking 1.6 GB of heap, actually it's buf array is holding 1.6GB data to be written over the socket.

Question - How can JVM throw out of memory even though there is sufficient heap space available. Is this temporary large object (ExposedByteArrayOutputStream) causing OOM?

链接地址: http://www.djcxy.com/p/81434.html

上一篇: 从Imgur api获取数据时出现403错误。 我哪里错了?

下一篇: 内存不足