We wanted to set the max old space size based on the memory limit so that the heap size inside out kubernetes pods is used better.
env:
- name: NODE_OPTIONS
value: '--max-old-space-size={{include "calculateJSHeapFromPodMemory" .memory}} --max-semi-space-size=16'