代码开发 - 当堆栈溢出发生时应该做什么以及应该设置什么堆栈提交大小和保留大小? [英] Code Development- What should be done when stack over flow occurs and what stack commit size and reserve size should be set?

查看:66
本文介绍了代码开发 - 当堆栈溢出发生时应该做什么以及应该设置什么堆栈提交大小和保留大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







解决方案

默认堆栈预留为1MB。 所以要做的第一件事就是调试问题并找出堆栈溢出的原因。 在这方面,递归函数通常会有问题。 使用大量的堆栈
来声明大型数组也是有问题的。


但最重要的是你需要分析你的代码如何使用堆栈。



解决方案

The default stack reservation is 1MB.  So the first thing to do is to debug the problem and figure out why the stack overflow occurs.  A recursive function can often be problematic in this regard.  And using significant amount of the stack in order to declare large arrays is also problematic.

But the bottom line is that you need to analyze how your code is using the stack.


这篇关于代码开发 - 当堆栈溢出发生时应该做什么以及应该设置什么堆栈提交大小和保留大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆