Node.js · Senior · Question 2 of 75

A container has 2 GB of memory, but the Node.js process crashes with 'JavaScript heap out of memory' at about 1.4 GB. What should you check?

Explanation

Recent Node.js versions size the heap from the container's memory limit, but the heap is not all memory: Buffers, native code and thread stacks live outside it. Leave a margin.

Further reading

Problem with a question

Node.js · Senior · question 2

Test yourself

Take the Node.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz