2016-09-20 84 views
-2

當我運行的Apache星火工作,輸入數據的這幾行中,執行JVM崩潰的原因在GC免費java.nio.DirectByteBufferJVM崩潰時java.nio.DirectByteBuffer試圖釋放內存在GC

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/

+2

我投票以關閉這個問題作爲脫離主題,因爲堆棧溢出不是一個調試服務。 – immibis

+0

這是最像JVM或Apache Spark中的錯誤。該錯誤表明它試圖釋放一些未被分配的東西。 –

+1

或雙重空閒,這可能是由使用內部API釋放DBB和參考處理程序之間的競爭造成的。 – the8472

回答

0

隨着@ the8472的建議下,我嘗試BTrac e並計算出DirectByteBuffer正在使用默認的Kyro串行器。 因此,我添加了自己的Kyro序列化程序來處理avro數據,現在一切正常。

0

你試圖用sun.misc.Unsafe api來解決內存問題,導致分段錯誤,從而導致jvm崩潰。

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

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

+0

是的,這是因爲我試圖使用'DirectByteBuffer'來減速器側的數據結構。 – gpcuster