-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
Observed behavior: There is no bound on the amount of memory used by $group.
Expected behavior: $group errors out if it consumes over 10% of physical ram (the same behavior as $sort).
Test
c = db.c; c.drop(); big = new Array( 10000 + 1 ).toString(); for( i = 0; i < 100000; ++i ) { c.save( { a:i, b:big } ); } // Errs out due to running out of memory. printjson( c.aggregate( { $sort:{ a:1 } }, { $limit:1 } ) ); // Does not err out. printjson( c.aggregate( { $group:{ _id:'$a', c:{ $addToSet:'$b' } } }, { $limit:1 } ) );
- is depended on by
-
SERVER-6862 improve usability of aggregation sort memory tracking
- Closed
- related to
-
SERVER-9444 Use new Sorter for Aggregation $sort and $group
- Closed
-
SERVER-6157 Refactor BSONObjExtSort
- Closed