
--max-old-space-size 옵션 관련
node.js의 —max-old-space-size 기본 값 확인 $ node > v8.getHeapStatistics() { total_heap_size: 6578176, total_heap_size_executable: 262144, total_physical_size: 6815744, total_available_size: 2193448312, used_heap_size: 5277544, heap_size_limit: 2197815296, malloced_memory: 163968, peak_malloced_memory: 172528, does_zap_garbage: 0, number_of_native_contexts: 2, number_of_detached_contexts: 0, total_global_handles_size: 8192, used_global_handles_size: 3040, external_memory: 2269138 } 기본값이 2GB인 것으로 확인함. 참고: https://stackoverflow.com/questions/48387040/how-do-i-determine-the-correct-max-old-space-size-for-node-js 수정 node.js 공식문서의 추천에 따르면, 서버 메모리 2GB 당 1536MB로 설정하라고 한다. pm2의 ecosystem 파일에 옵션을 추가하기위해, 파일을 아래와 같이 변경. { ... node_args: '--max-old-space-size=1536', ... }
- 1more