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

Disable extra threads for JSRuntimes

    XMLWordPrintableJSON

Details

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

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: