Possible memory leak in Spider Monkey

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.0.4
    • Component/s: JavaScript, MapReduce
    • None
    • Environment:
      OS X 10.7.3
    • OS X
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Tad Marshall
            Reporter:
            Ben Becker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: