Suppressing GC Execution in Android ART: Understanding HeapTaskDaemon and Hook Techniques
This article explains how the HeapTaskDaemon thread drives garbage collection in Android's ART runtime, analyzes its source code and related HeapTask classes, and presents two practical methods—adding custom HeapTasks or pausing existing ones—using ELF symbol lookup, ndk_dlopen, and virtual‑function hooking to temporarily suppress GC for better performance.