提交 4654bda8 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-4374 try this: it will set the stack size for the whole app to 240 if its too…

FS-4374 try this: it will set the stack size for the whole app to 240 if its too big or too small, if there are system limits, fs may have to be run as root and drop privs to be allowed to change this setting
上级 e06bf26e
......@@ -793,12 +793,11 @@ int main(int argc, char *argv[])
memset(&rlp, 0, sizeof(rlp));
getrlimit(RLIMIT_STACK, &rlp);
if (rlp.rlim_max > SWITCH_THREAD_STACKSIZE) {
if (rlp.rlim_cur != SWITCH_THREAD_STACKSIZE) {
char buf[1024] = "";
int i = 0;
fprintf(stderr, "Error: stacksize %d is too large: run ulimit -s %d from your shell before starting the application.\nauto-adjusting stack size for optimal performance...\n",
(int) (rlp.rlim_max / 1024), SWITCH_THREAD_STACKSIZE / 1024);
fprintf(stderr, "Error: stacksize %d is not optimal: run ulimit -s %d from your shell before starting the application.\nauto-adjusting stack size for optimal performance...\n",
(int) (rlp.rlim_cur / 1024), SWITCH_THREAD_STACKSIZE / 1024);
memset(&rlp, 0, sizeof(rlp));
rlp.rlim_cur = SWITCH_THREAD_STACKSIZE;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论