tezvyn:

Explain generational GC in ART and why onDraw must avoid allocations

Source: developer.android.comadvanced

WHAT IT TESTS: ART generational GC and onDraw allocation hazards. ANSWER OUTLINE: Covers young-gen nursery, mark-sweep fallback, and why a 5-10ms GC pause misses 16ms frame deadline. RED FLAG: Blaming GC without linking allocation to frame timing.

WHAT IT TESTS: Deep knowledge of ART memory management and real-time rendering constraints. ANSWER OUTLINE: A strong response explains how ART's young generation collects short-lived objects with stop-the-world pauses; rapid onDraw allocations can trigger a 5-10 ms GC that blows the 16.6 ms frame budget at 60 fps. It also notes concurrent GC is not free, and that zero-allocation onDraw removes the root cause.

Read the original → developer.android.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Explain generational GC in ART and why onDraw must avoid allocations · Tezvyn