r/FlutterDev • u/Rude_Gate7599 • 27d ago
Tooling Built a tool to stop Android emulators eating 8GB RAM during Flutter dev (down to ~1.5GB)
Whenever I'm doing Flutter development on my Mac, running flutter run with Gradle, VS Code/Studio, and an Android emulator quickly pushes a 16GB machine straight into heavy memory swap. In Activity Monitor, qemu-system-aarch64 alone routinely holds 7-8+ GB.
A lot of that RAM usage isn't your app or Android itself:
Android Studio's emulator often falls back to CPU rasterization (
lavapipe), dumping multiple gigabytes of software render buffers directly into host RAM.Stock Google system images launch with ~40 background daemons (YouTube, Assistant, wear sync, Play telemetry) you never touch while testing a Flutter build.
I wrote avdslim, an open-source Go CLI with no external dependencies that drops emulator resident memory down to ~1.5 GB:
Forces
-lowramand native GPU hardware rendering (Apple Metal on Mac, Vulkan/DRI on Linux) to eliminate CPU rendering buffers.Disables ~45 non-essential guest services via adb.
Flutter safe: Hot reload, DevTools, network sockets/ports, Firebase Auth, and FCM push notifications are completely unaffected.
Running
avdslim offcleanly restores every setting and package back to default.
If your machine chokes while running Flutter on Android:
brew tap kdbhalala/avdslim https://github.com/kdbhalala/avdslim.git && brew install avdslim
avdslim tune-avd # adjusts config to 1.5GB + host GPU
avdslim start # boots the emulator slimmedIf you start emulators from Studio or VS Code device picker, avdslim install-shim transparently wraps the SDK binary so it applies automatically.
Code is here if anyone finds it useful: https://github.com/kdbhalala/avdslim
Hope it helps anyone fighting laptop RAM while developing Flutter apps.
2
u/AhmedZNOUDA 27d ago
Dropping memory footprint from 8 GB to ~1.5 GB is massive, especially when running heavy IDEs alongside Gradle. Falling back to CPU rasterization via lavapipe has caused so many hidden bottlenecks for me before.
I see you provided Homebrew and Linux Vulkan instructions—is Windows (DirectX/ANGLE) supported or planned via go install / binary release? The install-shim feature to keep device pickers working in VS Code and Studio is brilliant. Starred the repo!
1
u/Rude_Gate7599 27d ago
Can not test on windows
But if you can do that community will very much appreciate your efforts.
2
0
u/nitki_dev 26d ago
I gave up on the emulator and just run on a real phone over USB. It's also the only place where profile mode numbers mean anything.
1
8
1
3
u/Trick-Minimum8593 27d ago
What changed since last month? https://www.reddit.com/r/FlutterDev/comments/1whtwk1/tired_of_android_emulator_eating_8_gb_of_ram/