-
Notifications
You must be signed in to change notification settings - Fork 1k
[Q] how to set memory size option #447
Comments
For anyone that happens upon this issue, it's in the documentation here: How would you do this for multiple options? |
Can you confirm then that this is not possible to change at runtime? That NODE_OPTIONS or any other way will not work, for example, if I don't want to bake 'max_old_space_size' into the binary, I want to change without needing to re-package. Thanks |
Any one can confirm that? |
This is a really important point for me. I need to build the exec in a way that is compatible with low-resource machines, but allow extending memory on some more heavy-duty machines.
|
stuck on setting multiple options. does not works how ever tried. Ease any simple thing I am missing? pkg app.js --options max-old-space-size=256 tls-min-v1.0 actually there are more options I need to add using SET NODE_OPTIONS=--max-old-space-size=256 --tls-min-v1.0 The compiled EXE only picks up 1 option through NODE_OPTIONS Since #447 is closed, what was resolution? |
you can concatenate multiple options (no space, comma separated)
|
Thank you @erossignon. It worked. Without clue I spend 40+ hours in 3 days taking internet down with searches and lots of experiments, all permutations. Please include this in README file, options section. |
Any solution for the initial question raised by #447 (comment)? |
It seems to have been disabled on purpose in |
A hello-world app works for // hello.js
const v8 = require('node:v8');
console.log('I have so much heap RAM:', v8.getHeapStatistics().total_available_size / 1024 / 1024, 'MB'); Build binary: Run it: > ./hello
> I have so much heap RAM: 4140.093421936035 MB
> NODE_OPTIONS='--max-old-space-size=2048' ./hello
> I have so much heap RAM: 2092.093421936035 MB |
node --max_old_space_size=4096 myAwesomeServer.js
How can I add (max_old_space_size) options to the pkg compression binary?
cf. environment setting also not working
export NODE_OPTIONS="--max-old-space-size=2048"
./pkged_binary
Pkg: FLAGS_MISMATCH
The text was updated successfully, but these errors were encountered: