Skip site navigation (1)Skip section navigation (2)
Date:      23 Jun 2003 03:00:04 -0000
From:      "D. J. Bernstein" <djb@cr.yp.to>
To:        freebsd-performance@freebsd.org
Subject:   Re: ten thousand small processes
Message-ID:  <20030623030004.40078.qmail@cr.yp.to>
References:  <20030621185821.30070.qmail@cr.yp.to>

next in thread | previous in thread | raw e-mail | index | archive | help
alloca() is inadequate. Memory allocation doesn't always follow a stack
pattern. I certainly can't predict memory use at the top of main().

sbrk() is dangerous. Suppose a system call that I'm using turns into a
library routine that calls malloc()---this has happened to poll() and to
socket(), so it could happen again. Suppose the malloc() implementor
assumes that the memory he gets from sbrk() is contiguous. Kaboom.

(If the sbrk() manual page said that this was the malloc() implementor's
fault, maybe I'd risk it. But the manual page clearly says I shouldn't.
``Duh, why would anyone want to use more than one allocator library?'')

Even if I get malloc() under control somehow, I'll still have 30-odd
unexplained VM pages going down the tubes. Is this, in fact, the stack?
Why doesn't it start at 4K?

---D. J. Bernstein, Associate Professor, Department of Mathematics,
Statistics, and Computer Science, University of Illinois at Chicago



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030623030004.40078.qmail>