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

JS "out of memory" should recover more gracefully

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.1
    • Component/s: JavaScript
    • Labels:
      None
    • Operating System:
      ALL

      Description

      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
      }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: