Profile-Guided Field Externalization in an Ahead-of-Time Compiler
Profile-Guided Field Externalization in an Ahead-of-Time Compiler
29 June 2025
Field externalization is a technique to reduce the footprint of objects by removing fields that most frequently contain zero or null. While researchers have developed ways to bring this optimization into the Java world, these have been limited to research compilers or virtual machines for embedded systems. In this work, we present a novel field externalization technique that uses information from static analysis and profiling to determine externalizable fields. During compilation, we remove those fields and define companion classes. These are used in case of non-default-value writes to the externalized fields. Our approach also correctly handles synchronization to prevent issues in multithreaded environments. We integrated our approach into the modern Java ahead-of-time compiler GraalVM Native Image. We conducted an evaluation on a diverse set of benchmarks that includes standard and microservice-based benchmarks. For standard benchmarks, our approach reduces the total allocated bytes by 2.76% and the maximum resident set size by 2.55%. For microservice benchmarks, the allocated bytes could be reduced by 6.88% and the maximum resident set size by 2.45%.
Venue : ECOOP 2024 https://2025.ecoop.org/
File Name : ecoop25-paper85.pdf