Application-Coordinated Garbage Collection
Motivation
In serverless and database environments, individual requests and queries often allocate temporary objects, but garbage collection can interrupt their execution and increase response latency. The Application-Coordinated Garbage Collection project investigates how application knowledge can guide garbage collection in GraalVM to reduce tail latency and memory use, while improving efficiency measured as throughput per unit of memory.
Application hints and adaptive collection
The project introduces hints through which applications and frameworks mark allocation sections and favorable collection points. These hints distinguish sections that primarily allocate temporary objects from those whose objects are expected to survive beyond the section. The runtime uses allocation statistics to decide when reclaiming memory is worth the cost of a collection, with the aim of moving collection pauses outside performance-critical request processing.
A complementary garbage collection policy dynamically adjusts heap parameters to the application's allocation patterns, building on research into dynamic garbage collector tuning (Karličić, 2024a) and a profiling-based adaptive policy for serverless applications (Karličić et al., 2024b). More frequent collections can reduce memory consumption but also lower throughput, so the goal is to balance these effects and increase the number of services that fit within available memory, an approach also explored in the patent on dynamic garbage collection for maximising service density (Ristović et al., 2026). Visualisation of the policy's metrics helps examine these trade-offs (Karličić et al., 2025). Research directions include collection heuristics, support for overlapping requests in multithreaded applications, and integration with different garbage collectors.
Acknowledgements
Application-Coordinated Garbage Collection is developed as part of the research collaboration between the Faculty of Mathematics and Oracle LLC.
References
- Milica Karličić: Poboljšanje efikasnosti klijent-server aplikacija dinamičkim podešavanjem parametara skupljača otpadaka u sistemu GraalVM. Masters Thesis, Faculty of Mathematics, University of Belgrade, 2024a. URL
- Milica Karličić, Ivan Ristović, Milena Vujošević Janičić: Profiling-Based Adaptive GC Policy for Serverless. Proceedings of the 14th Symposium "Mathematics and Applications", 2024b. URL
- Milica Karličić, Ivan Ristović, Milena Vujošević Janičić: Metrics Visualization Using Profiling-Based Adaptive GC Policy for Serverless. Proceedings of the 15th Symposium "Mathematics and Applications", 2025. URL
- Ivan Ristović, Milica Karličić, Vojin Jovanović, Milena Vujošević Janičić: Dynamic Garbage Collection Policy For Maximizing Service Density. US Letter Patent, ORC26170054-US-PSP, 2026.

