Studio, Profilers & Firebase Quiz

BUILD & TOOLING › Delivery

What is the primary mechanism by which a baseline profile speeds up app startup?

Answer: ART AOT-compiles listed hot methods at install, skipping JIT warm-up

Baseline profiles list hot code paths so ART can AOT-compile them at install time, skipping the interpret-then-JIT warm-up that otherwise slows early launches.

Which dependency configuration is the correct, recommended way to add LeakCanary?

Answer: debugImplementation 'com.squareup.leakcanary:leakcanary-android'

LeakCanary is added with debugImplementation so it auto-installs in debug builds only and never ships to production; no initialization code is required.

Roughly how long must an object stay reachable after being watched before LeakCanary treats it as retained and dumps the heap?

Answer: 5 seconds

ObjectWatcher waits about 5 seconds (and triggers a GC) before considering a still-reachable watched object retained, then captures a heap dump for Shark to analyze.

Which profiler capture is best suited to finding what is retaining objects and causing a memory leak?

Answer: Heap dump

A heap dump is a memory snapshot showing live objects and their reference chains, which is what you need to identify retained objects and their retaining references.

What is the role of the Firebase Bill of Materials (BoM) in an Android build?

Answer: It pins compatible Firebase versions so you omit each library's version

The Firebase BoM is a platform dependency that fixes compatible versions across all Firebase artifacts, so each product is declared without its own version number.

Which tool and rule are used to generate a baseline profile?

Answer: Macrobenchmark test with BaselineProfileRule

Baseline profiles are produced by a Macrobenchmark test using BaselineProfileRule.collect, which drives startup and user journeys to record the hot code paths.

Why does Android Studio's low-overhead profiling use a profileable (release-based) build rather than a debug build?

Answer: Profileable builds add less overhead, so timings stay realistic.

A profileable build is based on the release variant and profiles with low overhead, so timings better reflect production; debuggable profiling is needed only for allocation tracking and heap dumps, which it cannot do.

You need to change a feature's behavior for users in production without shipping a new build or going through review. Which Firebase product is designed for this?

Answer: Remote Config, serving server-set values the app fetches at runtime

Remote Config lets you define parameters server-side that the app fetches and activates at runtime, so behavior and rollouts can change without a new release.

Your release build is minified with R8, and Crashlytics stack traces show obfuscated class and method names. What makes them human-readable?

Answer: The Crashlytics Gradle plugin uploads the R8 mapping file for deobfuscation

The Crashlytics Gradle plugin uploads the R8/ProGuard mapping file at build time, letting the Crashlytics console map obfuscated names back to the original symbols.

Users report occasional stutter while scrolling a list, but average CPU looks fine. Which profiler capture best pinpoints the dropped frames and what is blocking the main thread?

Answer: A system trace of frame rendering and main-thread scheduling over time

A system trace visualizes per-frame rendering, thread scheduling, and main-thread work across time, which is exactly what is needed to find jank and what stalls the UI thread.

What is the key trade-off between a Callstack Sample (sampled) capture and a Method Trace (instrumented) capture in the CPU profiler?

Answer: Sampling polls cheaply but misses brief calls; instrumentation logs all at high cost.

Sampled traces poll the call stack at intervals for low overhead but may miss brief calls; instrumented traces log every entry and exit for exact counts and timing at a much higher performance cost.

Beyond a baseline profile, what does adding a startup profile do at build time?

Answer: It lets R8 group startup code together in the DEX files for faster loading

A startup profile is consumed by R8 to optimize DEX layout, placing startup classes and methods close together so they load faster, adding roughly a further 15% startup gain on top of the baseline profile.

After LeakCanary dumps the heap, what does the Shark analyzer compute to help you find the cause of a leak?

Answer: The shortest strong-reference path from a GC root to the object

Shark walks the heap dump to find the shortest path of strong references from a GC root to the retained object, producing the leak trace that points at what is holding it.

Your QA team needs to install signed pre-release builds on their own devices before the app goes to the Play Store. Which Firebase product is built for that?

Answer: App Distribution, for sending pre-release builds to testers

Firebase App Distribution exists to hand out pre-release (debug or release) builds to named testers quickly, outside the Play Store release flow.

Back to Studio, Profilers & Firebase