couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <>
Subject Re: 256kB stack size ok?
Date Wed, 22 Jun 2011 21:34:25 GMT
On Wed, Jun 22, 2011 at 05:50, MK <> wrote:
> Does anyone have an idea of what a safe minimum stack size is for
> couch?   I have it on a linux openVZ slice, and OVZ counts something
> called "allocated memory" which AFAICT most closely resembles the
> "writable/private" stat found with pmap -d.
> At start-up, beam.smp has 12 threads; with a default stack of 8MB each,
> that's 96MB.  After a while it grows to 25 threads and about a 1/4 GB
> of "allocated memory".    I'd expect that to be the minimum using a
> default stack size.
> So I cut the system stack size to 256kB, which reduced my overall mem
> usage by more than half,  and WRT to couch, about 90%.  Everything
> seems okay, but am totally unfamiliar with erlang, and was just
> wondering if someone in the know here can provide some reassurance.

This is an excellent question and it'd be really cool to hear some
good thoughts on this.

In particular, I'm not sure what (from a libc perspective) is stack
allocation and what is heap allocation in the Erlang runtime.
Looking around quickly it's not easy to find documentation on BEAM
itself (Bogdan/Björn's Erlang Abstract Machine).
I realize I don't even know if it's stack-based, what kind of
registers it has, etc...

Perhaps there are some more basic questions that we could cross-post to erlang?

View raw message