[ 
https://issues.apache.org/jira/browse/COUCHDB-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15707713#comment-15707713
 ] 

ASF GitHub Bot commented on COUCHDB-3245:
-----------------------------------------

GitHub user nickva opened a pull request:

    https://github.com/apache/couchdb-couch/pull/216

    Make couchjs -S option take effect

    Previously it was used to set JS context's stack chunk size.
    
    Instead, to be effective it should set max GC size of the runtime.
    
    Stack chunk size was set to the recommended value: 8K
    
    Reference:
    
    
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_NewContext
    
    COUCHDB-3245

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloudant/couchdb-couch couchdb-3245

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch/pull/216.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #216
    
----
commit 2bca9625aa6769b55520ebe796c5ccb5a55d3091
Author: Nick Vatamaniuc <[email protected]>
Date:   2016-11-30T05:37:12Z

    Make couchjs -S option take effect
    
    Previously it was used to set JS context's stack chunk size.
    
    Instead, to be effective it should set max GC size of the runtime.
    
    Stack chunk size was set to the recommended value: 8K
    
    Reference:
    
    
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_NewContext
    
    COUCHDB-3245

----


> couchjs -S option doesn't have any effect
> -----------------------------------------
>
>                 Key: COUCHDB-3245
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-3245
>             Project: CouchDB
>          Issue Type: Bug
>            Reporter: Nick Vatamaniuc
>
> currently -S option of couchjs sets stack _chunk_ size for js contexts
> Reference: to 
> https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_NewContext
> Documentation recommends 8K and I have seen cases where it was raised to 1G+ 
> in production!. That doesn't seem right at all and also probably kills 
> performance and eats memory. 
> Docs from above say:
> > The stackchunksize parameter does not control the JavaScript stack size. 
> > (The JSAPI does not provide a way to adjust the stack depth limit.) Passing 
> > a large number for stackchunksize is a mistake. In a DEBUG build, large 
> > chunk sizes can degrade performance dramatically. The usual value of 8192 
> > is recommended
> Instead we should be setting the max gc value which is set in the runtime
> {{JS_NewRuntime(uint32_t maxbytes)}}
> It seems that acts similarly to a max heap used (from what I understand). 
> Which makes more sense. A stack size of hundreds of megabytes doesn't sound 
> right.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to