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

Possible memory leak in Spider Monkey

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • 2.0.4
    • JavaScript, MapReduce
    • None
    • OS X 10.7.3
    • OS X

    Description

      The following shell script appears to leak memory in the mongo shell. This is a simplified script to reproduce behavior observed during MapReduce.

      > // Fresh start shows the mongo process using 27MB of resident mem.
      > result = {};
      { }
      > result2 = {};
      { }
      > for (i=0;i<640000;i++) {
      ...     result[i] = i * 3 % i;
      ...     result2[i] = result + 'aaaaaaaaaaaaaaaaaaaaaaaaa';
      ...     db.isMaster()
      ... }
      { "ismaster" : true, "maxBsonObjectSize" : 16777216, "ok" : 1 }
      > // At this point, the process is holding on to 268mb of resident mem
      > result = 0
      0
      > result2 = 0
      0
      > i = 0
      0
      > gc()
      > // At this point, the process is holding onto 186mb of resident mem

      This test assumes that removing references to all JS objects and running gc() would allow all memory to be reclaimed. I'm unsure if SM's GC should behave this way.

      Attachments

        Activity

          People

            tad Tad Marshall
            benjamin.becker Ben Becker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: