Bird
0
0

In Node.js, which of the following scenarios most commonly leads to memory leaks?

easy📝 Conceptual Q1 of 15
Node.js - Debugging and Profiling
In Node.js, which of the following scenarios most commonly leads to memory leaks?
AStoring references to unused objects in global variables
BUsing asynchronous functions with callbacks
CImporting modules multiple times
DUsing the latest ECMAScript syntax
Step-by-Step Solution
Solution:
  1. Step 1: Identify memory leak causes

    Memory leaks often occur when objects are unintentionally kept in memory.
  2. Step 2: Analyze options

    Storing unused objects in global variables prevents garbage collection.
  3. Final Answer:

    Storing references to unused objects in global variables -> Option A
  4. Quick Check:

    Global references block GC [OK]
Quick Trick: Unused global references cause leaks [OK]
Common Mistakes:
  • Assuming async callbacks cause leaks
  • Thinking module imports cause leaks
  • Believing syntax affects memory leaks

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes