[Ns-developers] [ns3] socket API
Mathieu Lacage
mathieu.lacage at sophia.inria.fr
Mon Apr 21 11:06:51 PDT 2008
On Mon, 2008-04-21 at 13:24 -0400, George Riley wrote:
> Both types of threads also of course each need a private stack, and
> the required size of this stack is not always
> obvious. A user will have to balance the need for stack space against
> total available
> memory and choose a good value that is "big enough", but not "too big".
It is also possible to make the stacks grow on-demand (at least, on
linux): these stacks need to be page-aligned and their size must be
multiples of the page size (which will suck at least 4K per stack). This
tends to eat virtual space really quickly on 32 bit systems because each
stack eats 2 pages of virtual space (which is 8K, even if only 1 page is
used) and, it fills the kernel virtual page mapping data structures with
lots of very small memory mappings which tends to kill page cache lookup
performance :/
So, I guess that simulating 5000 processes is definitely within reach of
even moderately-sized systems (something like 50MBs of RAM for 8K
stacks) but, going beyond that will probably be an interesting problem
on desktop-class machines.
Mathieu
More information about the Ns-developers
mailing list