MATLAB的堆栈大小是多少? [英] What is the stack size of MATLAB?
问题描述
MATLAB R2018a(64位)的默认堆栈大小是多少?
What is the default stack size of MATLAB R2018a (64-bit)?
似乎堆栈大小大于64位C#程序.
It seems that the stack-size is larger than an 64-bit C# program.
我为什么要问
I'm asking this question because I'm calling Intel MKLs LAPACKE_dtrtri which is heavily recursive.
我在.NET应用程序中使用该函数,并且从C#调用该函数时出现堆栈溢出错误,请参见
I'm using that function inside .NET application and I'm getting a stack overflow error when calling it from C#, see What is the stack size of a BackgroundWorker DoWork Thread? Is there way to change it?
另一方面,如果我从MATLAB调用.NET应用程序,则不会收到堆栈溢出错误.这就是我想知道MATLAB的堆栈大小的原因.
On the other side if I call my .NET application from MATLAB I'm not getting a stack overflow error. That's the reason I wanted to know what the stack size of MATLAB.
推荐答案
Using the dumpbin command I can take look at the header of the MATLAB.exe
.
dumpbin /headers "C:\Program Files\MATLAB\R2018a\bin\win64\MATLAB.exe"
这将返回
Dump of file C:\Program Files\MATLAB\R2018a\bin\win64\MATLAB.exe
PE signature found
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
8664 machine (x64)
...
OPTIONAL HEADER VALUES
...
4000000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
size of stack reserve
是十六进制的堆栈大小.
The size of stack reserve
is the stack size in hex.
因此,MATLAB的堆栈大小为67108864字节,即64兆字节.
So the stack size of MATLAB is 67108864 Bytes which is 64 Mega Bytes.
这篇关于MATLAB的堆栈大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!