Major - P3
Windows+Linux, MongoDB 2.4.5
Excess memory consumption due to over aggressive caching of V8 Isolates.
Switched to a fixed size cache, rather than a per connection cache.
There are a few workarounds.
Production release v2.4.7 contains the fix for this issue, and production release v2.6.0 will contain the fix as well.
512+32MB blocks are allocated per JS query type (M/R, eval, etc.).
These blocks seems to be deallocated only after connection close (even if this connection no longer runs server-side js).
We should make that heap global or reduce the occupied VM space per connection. Right now the upper bound is 2GB x (number of connections), which can exhaust 8TB Windows Address space at 4K concurrent connections.
Temporary workaround would be to destroy the cache after server-side JS finishes, but it will introduce additional latency in the M/R-heavy environments.