Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6272

aggregation does not track memory usage on osx

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None

      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 } ) );
      

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: