StackOverflowException in .NET

后端 未结 4 1338
名媛妹妹
名媛妹妹 2020-11-27 22:02

After hitting a few StackOverflowExceptions in .NET I noticed they completely bypass the unhandled exception handlers that .NET offers (Application.ThreadException / AppDoma

4条回答
  •  甜味超标
    2020-11-27 22:11

    A stackoverflow isn't something you can just recover from, since it can't allocate more stack memory to even call your exception handler.

    The only thing you can really do is track down the cause and prevent it from happening at all (eg becareful with recursion, and don't allocate large objects on the stack).

提交回复
热议问题