Node.js · Senior · Question 3 of 75

Which pattern is a classic cause of a memory leak in a Node.js server?

Explanation

Anything reachable from a module-level object lives forever. Use a bounded LRU cache with TTL, a WeakMap keyed by objects, or an external cache like Redis.

Further reading

Problem with a question

Node.js · Senior · question 3

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