Skip to main content
InterviewHubPRO
Section Overview
Q29

Question 29 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

58%
Flutter & Dart (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

How does Garbage Collection work in Dart?

senior LevelMemory Management

In Simple Words: Dart uses a generational garbage collector with two spaces:

  1. Young Generation (Scavenger): For short-lived objects (e.g. Flutter widgets created during rebuilds). Uses Cheney's copying algorithm to reclaim dead objects in sub-milliseconds without stopping the world.
  2. Old Generation (Mark-Sweep / Mark-Compact): For objects that survive multiple young-gen cycles (singletons, state stores). Runs infrequently in the background to avoid UI stutter.