Memory Management & Garbage Collection Questions

Memory as a performance resource in garbage-collected and managed runtimes (JVM, .NET, Go, V8, CPython). Covers allocation patterns and allocation pressure (boxing, value versus reference types, stack versus heap), GC algorithms and behaviour (generational, mark-and-sweep, reference counting, concurrent and compacting collectors, GC roots), pauses and tuning, heap sizing, fragmentation, object pooling and buffer reuse, data-oriented layouts and per-object overhead, on-heap versus off-heap trade-offs, and detecting and fixing memory leaks with heap dumps and profilers, including leaks from caches, closures, goroutines, asyncio tasks and native extensions. Emphasizes how memory pressure affects throughput, latency and stability, including low-latency and frame-rate-bound applications. Pointer, ownership and manual-allocation semantics, embedded memory budgets, virtual memory and paging, generic data-processing memory tricks, and GPU framework memory are covered elsewhere.

EasyTechnical
70 practiced

Can a memory leak happen in a garbage-collected language? Explain how, and how you would tell a real leak from normal heap growth.

MediumTechnical
71 practiced

An object you expected to be collected is still alive. Explain what GC roots are, and describe how long-lived caches, static or module-level variables, and captured closures can keep objects reachable. How would you confirm and fix it?

That is every published Memory Management & Garbage Collection question for Mobile Developer so far. Browse the other topics in this category, or practice this one interactively.