[Paper Review] DJXPerf: Identifying Memory Inefficiencies via Object-centric Profiling for Java
DJXPerf is a lightweight, object-centric memory profiler for Java that uses hardware performance monitoring counters (PMU) to attribute cache and TLB misses to specific Java objects, enabling developers to identify memory inefficiencies such as poor data locality and memory bloat. It incurs only ~8% runtime and ~5% memory overhead, requires no code or VM changes, and guides optimizations that yield significant speedups in real-world Java and Scala applications.
Java is the "go-to" programming language choice for developing scalable enterprise cloud applications. In such systems, even a few percent CPU time savings can offer a significant competitive advantage and cost saving. Although performance tools abound in Java, those that focus on the data locality in the memory hierarchy are rare. In this paper, we present DJXPerf, a lightweight, object-centric memory profiler for Java, which associates memory-hierarchy performance metrics (e.g., cache/TLB misses) with Java objects. DJXPerf uses statistical sampling of hardware performance monitoring counters to attribute metrics to not only source code locations but also Java objects. DJXPerf presents Java object allocation contexts combined with their usage contexts and presents them ordered by the poor locality behaviors. DJXPerf's performance measurement, object attribution, and presentation techniques guide optimizing object allocation, layout, and access patterns. DJXPerf incurs only ~8% runtime overhead and ~5% memory overhead on average, requiring no modifications to hardware, OS, Java virtual machine, or application source code, which makes it attractive to use in production. Guided by DJXPerf, we study and optimize a number of Java and Scala programs, including well-known benchmarks and real-world applications, and demonstrate significant speedups.
Motivation & Objective
- To address the lack of tools that analyze data locality and memory efficiency at the object level in managed languages like Java.
- To identify performance bottlenecks caused by poor spatial and temporal locality and memory bloat in enterprise Java applications.
- To provide a production-ready, low-overhead profiling solution that attributes hardware performance metrics to specific Java objects without modifying the JVM, OS, or application code.
- To guide developers in optimizing object allocation, layout, and access patterns based on real memory hierarchy behavior.
- To demonstrate measurable performance improvements in real-world and benchmark Java/Scala applications using object-centric insights.
Proposed method
- Leverages hardware performance monitoring units (PMU) to collect low-level cache and TLB miss statistics during application execution.
- Uses lightweight Java bytecode instrumentation to associate PMU events with specific Java objects and their allocation contexts.
- Applies statistical sampling to attribute performance metrics to both source code locations and individual objects, enabling object-centric profiling.
- Correlates object allocation sites with their usage patterns and access frequencies to identify objects suffering from poor locality or memory bloat.
- Presents profiling results ordered by performance impact, highlighting objects and code regions contributing most to memory latency.
- Employs a non-invasive, production-friendly design that requires no changes to the JVM, OS, or application source code.

Experimental results
Research questions
- RQ1Can hardware performance monitoring counters be effectively used to attribute memory hierarchy metrics (e.g., cache misses) to individual Java objects?
- RQ2How can object-centric profiling improve the identification of memory inefficiencies such as memory bloat and poor data locality in managed languages?
- RQ3What is the runtime and memory overhead of a profiling system that attributes PMU events to objects without modifying the JVM or application code?
- RQ4Can object-centric profiling guide practical optimizations that yield measurable performance improvements in real-world Java and Scala applications?
- RQ5How does object-centric profiling compare to traditional code-centric profiling in revealing hidden performance bottlenecks?
Key findings
- DJXPerf successfully identifies memory bloat and poor locality issues in real-world Java and Scala applications, including Dacapo benchmarks like luindex and lusearch.
- In the Dacapo 2006 luindex benchmark, moving an array allocation out of a method reduced memory footprint and improved performance, though the speedup was minimal (0.5%) due to low cache miss count.
- For the lusearch benchmark, caching a TopDocCollector object as a static field reduced running time by 1%, demonstrating measurable but modest gains from object-centric optimization.
- DJXPerf incurs only ~8% average runtime overhead and ~5% memory overhead, making it suitable for production deployment.
- The profiler enables developers to optimize object allocation and layout patterns based on actual memory access behavior, leading to nontrivial speedups in multiple case studies.
- Object-centric profiling reveals performance issues that are invisible to traditional code-centric profilers, especially those related to memory bloat and scattered object access patterns.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.