[英]Unable to make private java.nio.DirectByteBuffer(long,int) accessible
[英]JVM crash when java.nio.DirectByteBuffer trying to free memory in 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
并且没有内存压力:
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
完整的 hs_err 文件: http ://www.evernote.com/l/AAQu5abObUND5KFJbFNO9RpVfLQlBiwX6gg/
您尝试使用导致分段错误的 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 字节)@ 0x00007f082d519f94 [0x00007f082d5199c0+0x5d4] j java.lang.ref.Reference$ReferenceHandler.run()V+1 v ~StubRoutines::call_stub`
根据@the8472 的建议,我尝试了 BTrace 并发现DirectByteBuffer
来自默认的 Kyro 序列化程序。 所以我添加了我自己的 Kyro 序列化器来处理 avro 数据,现在一切都很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.