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:
Anthony Minessale 2012-07-02 11:20:05 -05:00
parent e06bf26e65
commit 4654bda84a
1 changed files with 3 additions and 4 deletions

View File

@ -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;