Skip to content

Instantly share code, notes, and snippets.

@tcrowe tcrowe/opti-node.js
Created Oct 3, 2017

Embed
What would you like to do?
Run node in a low memory or embedded environment (from 45MB normally to 14MB)
//
// node command-line arguments for making node run minimally in memory
//
let optiNodeArgs = [
// optimize for low memory system
'--optimize_for_size',
'--always_compact',
'--max_old_space_size=256',
// '--max_executable_size=300', // disabled in v8.x.x
// aggressive garbage collection
'--gc_interval=100', // what is the right interval value?
'--expose_gc', // call gc() function ad hoc
// es5 strict
'--use_strict',
'--no-harmony',
// debugging
// '--abort_on_uncaught_exception', // causes broken source map?
// '--abort_on_stack_overflow',
'--hard_abort'
]
@tcrowe

This comment has been minimized.

Copy link
Owner Author

tcrowe commented Oct 3, 2017

No loss in speed was noticed in my load testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.