How to Build an Android Memory Regression Gate at inDrive: CI Setup and Calibration
Learn how to build an Android memory regression gate using Macrobenchmark, CI emulators, baseline comparisons, PR blocking, and real-device validation.
This article outlines the setup and calibration process for building an Android memory regression gate at inDrive. The system uses Macrobenchmark with a custom memory sampler to measure memory usage during a series of user journeys through the app's most memory-intensive screens. A dedicated release-based build type is used for the tests, and ten user journeys, or scenarios, are performed.
The CI emulators used for testing include an Android 14 image and a fresh emulator for each scenario. The verdict for the gate is that growth should be warned when it exceeds the maximum of 3σ (standard deviation) or 8 MB relative to the main baseline, and blocked when it exceeds 4 MB above that, never falling below 12 MB. Cloud-hosted phones are also used for testing, with two models being run twice a day on main and in response to emulator warnings.
The test is designed to run on PRs for selected scenarios, while the full suite runs on main twice each night. The calibration process involves diff-selecting scenarios, running them on PRs, and computing a screen's level as one median across all passes on all emulators.
Rewritten by urgent.news; may contain errors — check the original.
Source: hackernoon.com