简体   繁体   English

java.nio.DirectByteBuffer 尝试在 GC 中释放内存时 JVM 崩溃

[英]JVM crash when java.nio.DirectByteBuffer trying to free memory in GC

When I was running a Apache Spark job, which few lines of input data, the executor JVM crashed due to free java.nio.DirectByteBuffer in the GC:当我运行 Apache Spark 作业时,其中几行输入数据,由于 GC 中的空闲java.nio.DirectByteBuffer ,执行器 JVM 崩溃:

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.misc.Unsafe.freeMemory(J)V+0
j  java.nio.DirectByteBuffer$Deallocator.run()V+17
J 1537 C1 java.lang.ref.Reference.tryHandlePending(Z)Z (115 bytes) @ 0x00007f082d519f94 [0x00007f082d5199c0+0x5d4]
j  java.lang.ref.Reference$ReferenceHandler.run()V+1
v  ~StubRoutines::call_stub

And there was no memory pressure:并且没有内存压力:

Heap:
par new generation   total 153344K, used 17415K [0x0000000738000000, 0x0000000742660000, 0x0000000742660000)
eden space 136320K,   1% used [0x0000000738000000, 0x00000007381955c8, 0x0000000740520000)
from space 17024K,   92% used [0x0000000740520000, 0x000000074148c778, 0x00000007415c0000)
to   space 17024K,    0% used [0x00000007415c0000, 0x00000007415c0000, 0x0000000742660000)
concurrent mark-sweep generation
total 2057856K, used 76674K [0x0000000742660000, 0x00000007c0000000, 0x00000007c0000000)
Metaspace       used 49890K, capacity 50454K, committed 50540K, reserved 1093632K
class space     used 6821K, capacity 6995K, committed 7056K, reserved 1048576K

Full hs_err file: http://www.evernote.com/l/AAQu5abObUND5KFJbFNO9RpVfLQlBiwX6gg/完整的 hs_err 文件: http ://www.evernote.com/l/AAQu5abObUND5KFJbFNO9RpVfLQlBiwX6gg/

You tried to play around with memory using sun.misc.Unsafe api's that resulted in segmentation fault, hence jvm crashed.您尝试使用导致分段错误的 sun.misc.Unsafe api 来处理内存,因此 jvm 崩溃了。

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)

j sun.misc.Unsafe.freeMemory(J)V+0 j java.nio.DirectByteBuffer$Deallocator.run()V+17 J 1537 C1 java.lang.ref.Reference.tryHandlePending(Z)Z (115 bytes) @ 0x00007f082d519f94 [0x00007f082d5199c0+0x5d4] j java.lang.ref.Reference$ReferenceHandler.run()V+1 v ~StubRoutines::call_stub` j sun.misc.Unsafe.freeMemory(J)V+0 j java.nio.DirectByteBuffer$Deallocator.run()V+17 J 1537 C1 java.lang.ref.Reference.tryHandlePending(Z)Z(115 字节)@ 0x00007f082d519f94 [0x00007f082d5199c0+0x5d4] j java.lang.ref.Reference$ReferenceHandler.run()V+1 v ~StubRoutines::call_stub`

With @the8472 's suggestion, I tried BTrace and figured out the DirectByteBuffer are comming from default Kyro serializer.根据@the8472 的建议,我尝试了 BTrace 并发现DirectByteBuffer来自默认的 Kyro 序列化程序。 So I added my own Kyro serializer to deal with avro data and everything is fine now.所以我添加了我自己的 Kyro 序列化器来处理 avro 数据,现在一切都很好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使私有 java.nio.DirectByteBuffer(long,int) 可访问 - Unable to make private java.nio.DirectByteBuffer(long,int) accessible 无法使用修饰符“public”访问类java.nio.DirectByteBuffer(在模块java.base中)的成员 - cannot access a member of class java.nio.DirectByteBuffer (in module java.base) with modifiers “public” 为什么我在 Mac 上看到 `java.lang.reflect.InaccessibleObjectException: Unable to make private java.nio.DirectByteBuffer(long,int) accessible` - Why am I seeing `java.lang.reflect.InaccessibleObjectException: Unable to make private java.nio.DirectByteBuffer(long,int) accessible` on a mac apache-spark 运行时出现警告,org.apache.spark.unsafe.Platform java.nio.DirectByteBuffer(intlong,int) 进行非法反射访问 - apache-spark running with warnings with Illegal reflective access by org.apache.spark.unsafe.Platform java.nio.DirectByteBuffer(long,int) jvm崩溃..没有足够的免费记忆? (1.6) - jvm crash.. not enough free memory? (1.6) GC Clojure/Java/JVM 内存设置 - GC Clojure/Java/JVM memory settings Java 8 JVM挂起,但内存不足时不会崩溃/堆转储 - Java 8 JVM hangs, but does not crash/ heap dump when out of memory Java GC 上的低内存停止和崩溃程序 - Java GC on low memory stop and crash program Java-Tomcat GC无法释放..总是会导致崩溃,找不到任何内存泄漏 - Java - Tomcat GC won't free up.. always cause crash, can't find any memory leak 在Linux上的java热点jvm中使用大页面和DirectByteBuffer - Using huge pages and DirectByteBuffer in java hotspot jvm on Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM