Difficulty: Easy
Correct Answer: Garbage collection
Explanation:
Introduction / Context:
Modern runtimes must manage memory to avoid leaks and fragmentation. Many languages and VMs provide automatic memory management so developers do not manually free every allocation. This automation improves safety and productivity but requires clear terminology awareness.
Given Data / Assumptions:
Concept / Approach:
Garbage collection identifies objects with no live references and returns their memory to the free pool. Algorithms include mark-and-sweep, copying, generational, and concurrent collectors. The goal is to balance pause times, throughput, and memory overhead while maintaining application correctness.
Step-by-Step Solution:
1) Determine that the process is about recycling unused memory.
2) Map to canonical terminology: “garbage” = unreachable objects, “collection” = reclamation.
3) Eliminate unrelated mechanisms (diagnostics, dumps, DMA).
4) Select “Garbage collection.”
Verification / Alternative check:
Language docs (Java, C#, Go) explicitly label this process garbage collection and describe tuning parameters that control how and when reclaiming occurs.
Why Other Options Are Wrong:
Diagnostic routine: troubleshooting tool, not memory reclamation. Memory dump: snapshot of memory for debugging. Direct memory access: device I/O technique bypassing CPU for data transfer.
Common Pitfalls:
Assuming GC removes the need for good memory hygiene; retaining references accidentally still causes leaks. Also, GC pauses can affect latency if not tuned and profiled.
Final Answer:
Garbage collection
Discussion & Comments