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

JS "out of memory" should recover more gracefully

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.1
    • Affects Version/s: None
    • Component/s: JavaScript
    • None
    • ALL

      Once you get an "out of memory" error, the JavaScript runtime becomes unusable.

      // Add this to system.js
      { "id" : "f1", "value" : function cf2f {
      a = [];
      b = [];
      c = [];
      for (i = 0; i < n; i++)

      { a.push(Math.random()); b.push(Math.random()); c.push(Math.random()); }

      } }

      // Then execute this:
      > db.eval("f1(10)")
      null
      > db.eval("f1(10000)")
      null
      > db.eval("f1(100000)")
      null
      > db.eval("f1(1000000)")
      Thu Apr 28 11:21:45 uncaught exception: {
      "errno" : -3,
      "errmsg" : "invoke failed: JS Error: out of memory nofile_b:6",
      "ok" : 0
      }
      > db.eval("f1(10)")
      Thu Apr 28 11:21:49 uncaught exception: {
      "errno" : -3,
      "errmsg" : "invoke failed: JS Error: out of memory nofile_b:1",
      "ok" : 0
      }

            Assignee:
            antoine Antoine Girbal
            Reporter:
            kbanker Kyle Banker
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: