-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Query Execution
-
None
-
Fully Compatible
-
QE 2021-10-04, QE 2021-10-18
Currently, when we are requesting a piece of memory that might contain a BSON object, it usually requires BSONObjMaxUserSize bytes (i.e., 16MB) plus a residual amount of memory for its wrapper data structure, which is BSONObjMaxInternalSize bytes (i.e., 16MB+16KB). Then, we ask the buffer builder to allocate this much memory, it tries to allocate an amount of memory that's a power of two. In this case, it allocates 32MB of memory, which is usually a waste of resources.
In this ticket, based on the discussions with bernard.gorman, david.storch and redbeard0531, we want to change the buffer builder logic in the grow_reallocate to allocate BSONObjMaxInternalSize bytes if the requested re-allocated amount is anything between BSONObjMaxUserSize and BSONObjMaxInternalSize bytes.
- is depended on by
-
SERVER-36346 Large memory consumption per pending getmore
- Closed
- is related to
-
SERVER-60115 Fix the Buffer Builder to Correctly use Powers of Two Allocations
- Closed
-
SERVER-60116 Fix Excessive Pointer Arithmetics in the Buffer Builder
- Closed