Heap profiling for space-efficient Java

  • Authors:
  • Ran Shaham;Elliot K. Kolodner;Mooly Sagiv

  • Affiliations:
  • Tel-Aviv University and IBM Haifa Research Laboratory;IBM Haifa Research Laboratory;Tel-Aviv University

  • Venue:
  • Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a heap-profiling tool for exploring the potential for space savings in Java programs. The output of the tool is used to direct rewriting of application source code in a way that allows more timely garbage collection (GC) of objects, thus saving space. The rewriting can also avoid allocating some objects that are never used.The tool measures the difference between the actual collection time and the potential earliest collection time of objects for a Java application. This time difference indicates potential savings. Then the tool sorts the allocation sites in the application source code according to the accumulated potential space saving for the objects allocated at the sites. A programmer can investigate the source code surrounding the sites with the highest savings to find opportunities for code rewriting that could save space. Our experience shows that in many cases simple code rewriting leads to actual space savings and in some cases also to improvements in program runtime.Experimental results using the tool and manually rewriting code show average space savings of 18% for the SPECjvm98 benchmark suite. Results for other benchmarks are also promising. We have also classified the program transformations that we have used and argue that in many cases improvements can be achieved by an optimizing compiler.