[SERVER-22688] Provide a setParameter and shell option to control the js heap limit Created: 17/Feb/16  Updated: 04/Jan/17  Resolved: 15/Sep/16

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 3.3.1
Fix Version/s: 3.3.14

Type: Improvement Priority: Major - P3
Reporter: Mira Carey Assignee: Waley Chen
Resolution: Done Votes: 0
Labels: bkp, fuzzer-blocker
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-22644 Overriding the Error object causes in... Closed
Documented
is documented by DOCS-8932 Provide a setParameter and shell opti... Closed
Related
related to SERVER-27177 Segfault after lowering jsHeapLimitMB Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.2
Sprint: Platforms 2016-08-26, Platforms 2016-09-19
Participants:

 Description   

The server currently has a hard limit on heap size for each js scope which is set to 1.1 GB. In the shell we avoid setting any limit.

This leads to situations where jstestfuzz can't verify some js expressions (because some tests in the shell get OOM killed rather than soft limited, because we can't set a limit in the shell) and where users can't ask for more memory server side if they actually want it (for expensive map reduce operations).

Adding a setParameter and shell option would cover both of these use cases at relatively little cost.

The other option to consider is a function that can be invoked from JS, but then we're in a situation where we'd have to work out access control for allowing us to raise the limit, or have only a function that can lower the limit. Moving the limit out of js is cleaner from an authorization perspective.



 Comments   
Comment by Githook User [ 15/Sep/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-22688 Provide a setParameter and shell option to control the js heap limit
lint fix
Branch: master
https://github.com/mongodb/mongo/commit/a657b38c56b34ad573d45ecb4f80772297b9e5d9

Comment by Githook User [ 15/Sep/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-22688 Provide a setParameter and shell option to control the js heap limit
Branch: master
https://github.com/mongodb/mongo/commit/2b0e9e69b7ae373bd11dff3c0814dec981806c4c

Comment by Githook User [ 13/Sep/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: Revert "SERVER-22688 Provide a setParameter and shell option to control the js heap limit"

This reverts commit 955cf8c998a60a8c2a2493dd428dd3d763e90259.
Branch: master
https://github.com/mongodb/mongo/commit/6471618952c8727bc5b06039ed2cf861e1a36436

Comment by Githook User [ 13/Sep/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-22688 Provide a setParameter and shell option to control the js heap limit
Branch: master
https://github.com/mongodb/mongo/commit/955cf8c998a60a8c2a2493dd428dd3d763e90259

Generated at Thu Feb 08 04:01:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.