We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I am trying to adjust the node heap limit of my app running on bytenode, but I couldn't.
Steps to reproduce:
Create a test.js file: console.log(`node heap limit = ${ require('v8').getHeapStatistics().heap_size_limit / (1024 * 1024) } Mb`)
console.log(`node heap limit = ${ require('v8').getHeapStatistics().heap_size_limit / (1024 * 1024) } Mb`)
Execution using node: node test.js Output node heap limit = 2096 Mb
node test.js
node heap limit = 2096 Mb
Execution using node with --max-old-space-size: node --max-old-space-size=7500 test.js Output node heap limit = 7548 Mb
node --max-old-space-size=7500 test.js
node heap limit = 7548 Mb
Execution using bytenode: node --max-old-space-size=7500 node_modules/bytenode/lib/cli.js ./test.jsc Output node heap limit = 2096 Mb
node --max-old-space-size=7500 node_modules/bytenode/lib/cli.js ./test.jsc
Execution using bytenode sending --max-old-space-size: node node_modules/bytenode/lib/cli.js ./test.jsc --max-old-space-size=7500 Output node heap limit = 2096 Mb
node node_modules/bytenode/lib/cli.js ./test.jsc --max-old-space-size=7500
So my next attempt was to fork a process sending --max-old-space-size on execArgv:
console.log(`node heap limit = ${ require('v8').getHeapStatistics().heap_size_limit / (1024 * 1024) } Mb`) const cluster = require('cluster'); if (cluster.isMaster) { cluster.setupMaster({ execArgv: ['--max-old-space-size=7500'], }); cluster.fork(); }
node test.js Output:
node heap limit = 2096 Mb node heap limit = 7548 Mb
If I execute the same code using bytenode:
node heap limit = 2096 Mb test.jsc:1 ���$S�:J SyntaxError: Invalid or unexpected token at wrapSafe (internal/modules/cjs/loader.js:1053:16) at Module._compile (internal/modules/cjs/loader.js:1101:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47```
The text was updated successfully, but these errors were encountered:
This should work:
node --max-old-space-size=7500 -r bytenode test.jsc
Given that bytenode is installed locally.
bytenode
Sorry, something went wrong.
This bug should be fixed in cli.js. Thank you for reporting.
cli.js
No branches or pull requests
Hello,
I am trying to adjust the node heap limit of my app running on bytenode, but I couldn't.
Steps to reproduce:
Create a test.js file:
console.log(`node heap limit = ${ require('v8').getHeapStatistics().heap_size_limit / (1024 * 1024) } Mb`)
Execution using node:
node test.js
Output
node heap limit = 2096 Mb
Execution using node with --max-old-space-size:
node --max-old-space-size=7500 test.js
Output
node heap limit = 7548 Mb
Execution using bytenode:
node --max-old-space-size=7500 node_modules/bytenode/lib/cli.js ./test.jsc
Output
node heap limit = 2096 Mb
Execution using bytenode sending --max-old-space-size:
node node_modules/bytenode/lib/cli.js ./test.jsc --max-old-space-size=7500
Output
node heap limit = 2096 Mb
So my next attempt was to fork a process sending --max-old-space-size on execArgv:
node test.js
Output:
If I execute the same code using bytenode:
The text was updated successfully, but these errors were encountered: