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
This commit is contained in:
parent
e06bf26e65
commit
4654bda84a
|
@ -793,12 +793,11 @@ int main(int argc, char *argv[])
|
||||||
memset(&rlp, 0, sizeof(rlp));
|
memset(&rlp, 0, sizeof(rlp));
|
||||||
getrlimit(RLIMIT_STACK, &rlp);
|
getrlimit(RLIMIT_STACK, &rlp);
|
||||||
|
|
||||||
if (rlp.rlim_max > SWITCH_THREAD_STACKSIZE) {
|
if (rlp.rlim_cur != SWITCH_THREAD_STACKSIZE) {
|
||||||
char buf[1024] = "";
|
char buf[1024] = "";
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
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",
|
||||||
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_cur / 1024), SWITCH_THREAD_STACKSIZE / 1024);
|
||||||
(int) (rlp.rlim_max / 1024), SWITCH_THREAD_STACKSIZE / 1024);
|
|
||||||
|
|
||||||
memset(&rlp, 0, sizeof(rlp));
|
memset(&rlp, 0, sizeof(rlp));
|
||||||
rlp.rlim_cur = SWITCH_THREAD_STACKSIZE;
|
rlp.rlim_cur = SWITCH_THREAD_STACKSIZE;
|
||||||
|
|
Loading…
Reference in New Issue