java.lang.StackOverflowError stack exception (solution)

Hello, I’m Chenxi. Let’s meet again. I have sorted out a java.lang.StackOverflowError I recently encountered. I hope it will be helpful to you in solving the problem. Let’s make progress together~

It’s really stupid recently... I wrote a serious bug... This exception occurred
Insert picture description here


Stack overflow error. If the size of the stack used by a thread> the maximum stack size allowed by the configuration, the jvm will throw java.lang.StackOverflowError


Solutions:

Reason 1: The system space is indeed insufficient

Reason 2: The program has an infinite loop (for example, it keeps calling itself recursively)


Insert picture description here

How to solve this problem?

Look at the log and log in to the server to see the log. After
Insert picture description here
logging in, you can directly find that the 93 and 102 lines of code have been cyclically called, you can directly locate the problem, and then find that it is recursively called by yourself, so the stack overflows.


Reflection summary: If you report a bug for a project that is already online, do not think about it. Look at the log, watch the log, and watch the log.


The best investment is to invest in yourself.

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45393094/article/details/108190689