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

Disable extra threads for JSRuntimes

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.0-rc6
    • Affects Version/s: 3.2.0-rc5
    • Component/s: JavaScript
    • None
    • Fully Compatible
    • ALL
    • Platform D (12/11/15)

      When extra threads are enabled in spidermonkey, objects with finalizers cannot be run from garbage collection threads. This prevents any of our native types from reaping in hot loops in js (at idle the main thread may decide to gc).

      By invoking js::DisableExtraThreads() we can prevent all of the various helper threads from getting spun up. This means compilation, gc, etc. are all run from the runtime they're invoke in, rather than a helper. Unfortunately js::DisableExtraThreads is in vm/Runtime.h, a non-public header. We can simply forward declare it ourselves.

      This appears to fix the memory leaks we see in SERVER-21709

            Assignee:
            mira.carey@mongodb.com Mira Carey
            Reporter:
            mira.carey@mongodb.com Mira Carey
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: