Set memory limits using both Docker and v8

    Code Example – Memory limit with Docker

    Bash

    Kubernetes deployment yaml

    1. kind: Pod
    2. metadata:
    3. name: my-node-app
    4. containers:
    5. - name: my-node-app
    6. requests:
    7. memory: "400Mi"
    8. limits:
    9. command: ["node index.js --max-old-space-size=350"]

    Kubernetes documentation: “If you do not specify a memory limit”

    From Docker official docs

    Node.js documentation: “V8 will spend more time on garbage collection”

    From Node.js official docs