How to know about OutOfMemory or StackOverflow errors ahead of time

前端 未结 11 1759
余生分开走
余生分开走 2021-02-15 17:10

In Java, is there a way to know that a StackOverflow error or OutOfMemory exception may happen soon?

The OutOfMemory exception m

11条回答
  •  故里飘歌
    2021-02-15 17:47

    You should never see a StackOverflow exception if your application is designed and implemented correctly!

    Generally, if you get a StackOverflow exception then it's a sign that there's a bug in your recursion code.

提交回复
热议问题