StackOverflowError when i serialize an object

杀马特。学长 韩版系。学妹 提交于 2019-12-06 12:11:30

CRDT is the superclass of the Object m which is serialized. The error is that the class that derives from CRDT seems to have a reference to itself, leading to an endless recursion
You see that in the stack trace.
Tipp find out the class of The object CRDT m: by either using the debugger, or adding an System.out.println(m.getClass()) at the beginn of your serialize() method. Then when you know the class, check wheter the object has a reference to itself.

You haven't posted your concrete classes so its hard to spot the error but
In short, any recursive algorithm can overflow the stack and stack is finite.
For deeply nested object graphs Java builtin serlialization requires excessive stack space.
for elaborate details refer
http://c2.com/cgi/wiki?JavaSerializationIsBroken
http://c2.com/cgi/wiki?JavaSerializationAndTheStack

i juste add -Xss512m to Netbeans and it's work :D

BTW, I had same issue but looks like mine was related to checkpoint duration being too big. It appear, Spark maintains some sort of object linkage while writing it out and if the duration is too big it will get stack overflown.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!