application crashes when trying to serialize. Are there any tools or ways to see what kind of objects occupied the entire stack, so that it was easier to identify cyclical dependencies (although they are jvm,

  • Options: 1. View the stack 2. Log all the code and find the place where the recursion started. 3. Comment line by line until the problem code is found. And after that you can add that problem code to this question :) - gil9red
  • Most likely you have circular references in the object tree that you are trying to serialize. - user180704
  • So, I think here it is necessary to specify what mechanism is used for serialization. - Pavel Mayorov
  • 99.9% yes, cyclic links. The thing is that java can solve them, but eats up a stack of calls at the same time. Since there are a lot of different sheets, I would like to know which of them breaks the serialization, in order to sit down and have a separate task to cut these circular dependencies - Roberto

1 answer 1

Intercept java.lang.StackOverflowError (attention, this is an Error inheritor and not an Exception!) And call it printStackTrace() .

  • I will see a stack of recurring calls, but how to see the sheets with which objects overflowed the stack during the fall? - Roberto
  • one
    @VladislavOsipenkov debugger + breakpoints will help you. - user180704