bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [bug #18396] stack size setrlimit call interacts badly with Solaris/


From: Martin Dorey
Subject: RE: [bug #18396] stack size setrlimit call interacts badly with Solaris/x86 kernel bug
Date: Tue, 28 Nov 2006 18:45:02 -0800

> Using heap, which requires a system call to get more memory

(It doesn't affect the main point of Paul's reply but just for academic
interest) no it doesn't:

address@hidden:~/playpen$ cat ten-thousand-mallocs.c 
#include <stdlib.h>

int main() {
  for (int ii = 0; ii != 10 * 1000; ++ ii) {
    free(malloc(1));
  }
}
address@hidden:~/playpen$ g++ ten-thousand-mallocs.c 
address@hidden:~/playpen$ strace ./a.out 2>&1 | wc -l
152
address@hidden:~/playpen$

Even in less contrived applications, brk isn't called anything like as
often as malloc.
-------------------------------------
Martin's Outlook, BlueArc Engineering




reply via email to

[Prev in Thread] Current Thread [Next in Thread]