[SERVER-21728] Disable extra threads for JSRuntimes Created: 02/Dec/15  Updated: 08/Dec/15  Resolved: 03/Dec/15

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 3.2.0-rc5
Fix Version/s: 3.2.0-rc6

Type: Bug Priority: Major - P3
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-21709 Map Reduce causes segfault in 3.2 RC4 Closed
is depended on by SERVER-21716 SpiderMonkey doesn't appear capable o... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platform D (12/11/15)
Participants:

 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



 Comments   
Comment by Githook User [ 02/Dec/15 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-21728 Disable extra JS Threads
Branch: master
https://github.com/mongodb/mongo/commit/0eb5b0ecc379a5ad1b00aab56e7432ce76d13ac9

Generated at Thu Feb 08 03:58:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.