SERVER-134946ClosedFixed

Spurious JSInterpreterFailure "Out of memory"

Server-side JavaScript fails with {{JSInterpreterFailure}} "Out of memory" while the actual SpiderMonkey heap is nearly empty. MongoDB's JS memory counter ({{{}mongo::sm::malloc_bytes{}}}) is incremented when a {{mozilla::StringBuffer}} is allocated but never decremented when it is released, so it tracks cumulative string allocation instead of live memory. Once it crosses {{internalQueryJavaScriptHeapSizeLimitMB}} (default 100MB) the operation is killed.

Affected Versions
Versions known to exhibit this issue
8.0.32
Fixed Versions
Versions that include the fix
9.1.0-rc09.1.0-rc10249.0.9
Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.