如何设置dart vm的最大堆栈大小

时间:2015-02-07 02:28:36

标签: dart

我无法在dart -v中找到与堆栈大小相关的选项,如V8中的--stack_size。简单地设置ulimit没有任何效果。这是我测试的方式。

foo(n){
  print(n);
  foo(n+1);
}

main(){
  foo(1);
}

更新

截至2015/02/12,线程堆栈大小不可配置,默认为(128 * kWordSize * KB)[参见OSThread :: GetMaxStackSize] [来源] 1

1 个答案:

答案 0 :(得分:0)

https://code.google.com/p/dart/issues/detail?id=8557#c2

Stack space for the main thread is not set by the VM, but by the OS on launch. ...

此答案https://unix.stackexchange.com/a/127615/40327表示可以传递特定值,但存在默认值。我认为这就是Dart所做的,使用操作系统默认值

(类似但适用于Windows https://msdn.microsoft.com/en-us/library/windows/desktop/ms686774(v=vs.85).aspx