|
Observed behavior: No memory assertion is triggered for a large $sort on osx.
Expected behavior: A memory assertion is triggered for a large $sort on osx, the same as on linux.
The reason seems to be that on osx SystemInfo::getPhysicalRam() returns 0, likely because systeminfo_none.cpp is used rather than the linux or win32 variants.
Test
c = db.c;
|
c.drop();
|
|
big = new Array( 10000 + 1 ).toString();
|
|
for( i = 0; i < 100000; ++i ) {
|
c.save( { a:i, b:big } );
|
}
|
|
// This fails with a memory assertion on linux, but (eventually) generates a result on an osx box with the same amount of ram.
|
printjson( c.aggregate( { $sort:{ a:1 } }, { $limit:1 } ) );
|
|