I have a crash dump that shows that simple index build over 1.2 million of small docs eats tons of ram. I'm going to attach erlang crash dump where you can see second biggest process (0.7277.2 or sort by stack+heap) is index updater.
NOTE: crash itself was caused by attempt to grab diag so biggest process died because of that, but real cause seems to be index building.
|For Gerrit Dashboard: &For+MB-6096=message:MB-6096|
|19430,3||MB-6096 Fix too high memory consumption during indexing||couchdb||Status: MERGED||+2||+1|
|19553,1||MB-6096 Use enif_alloc()/enif_free() in ejson decoder||couchdb||Status: MERGED||+2||+1|