skip to main content
10.1145/378795.378820acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Heap profiling for space-efficient Java

Published:01 May 2001Publication History

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.

References

  1. 1.O. Agesen, D. Detlefs, amd E. Moss. Garbage Collection amd Locad Vau'iable Type-Precision and Liveness in Java Virtual Mamhines. In SIGPLAN Conf. on Prog. Lang. Design and Impl., pages 269-279, June 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2.J. M. Barth. Shifting garbage collection overhead to compile time. Commun. ACM, 20(7):513-518, 1977.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.B. Blanchet. Escape amdysis for object oriented languages, application to Javatin. In Conf. on Object-Oriented Prog. Syst., Lang. and AppL, Denver, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.R. Bodlk, R. Gupta, amd M. L. Sofia. Complete removal of redundant expressions. ACM SIGPLAN Notices, 33(5):1 14, May 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.A. Deutsch. Semantic models and abstramt interpretation for inductive data structures amd pointers. In Proc. of ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, PEPM'95, pages 226 228, New York, NY, June 1995. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.E. Duesterwald, R. Gupta, and M. Sofia. A practical farmework for demand driven interprocedural data flow analysis. In Trans. on Prog. Lang. and Syst., 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.J. Gosling, B. Joy, and G. Steele. The Java Language Specification. The Java Series. Addison-Wesely, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.G. W. Hamilton. Compile-time garbage collection for lazy functiomd languages. In Memory Management, International Workshop IWMM 95, 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9.M. Hind and A. Pioli. Which pointer analysis should I use? In Int. Symp. on Soft. Test. and Anal., 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.IBM JDK 1.3. Available at http://www.ibm.com/java.]]Google ScholarGoogle Scholar
  11. 11.JavaCC - The Java Parser Generator. Available at http://www.met mnat a.com/j avamc.]]Google ScholarGoogle Scholar
  12. 12.Java Grande Benchmark Suite. Available at http://www.epcc.ed.ac.uk/j avagmnde.]]Google ScholarGoogle Scholar
  13. 13.Sun JDK 1.2. Available at http://java.sun.com/j2se.]]Google ScholarGoogle Scholar
  14. 14.Sun HotSpot Client 1.3. Available at http: //java.sun.com/products/hotspot.]]Google ScholarGoogle Scholar
  15. 15.T. P. Jensen and T. Mogensen. A backward analysis for compile-time garbage collection. In European Symp. on Prog., pages 222-239, 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16.R. Jones. Garbage Collection. Algorithms for Automatic Dynamic Memory Management. John Wiley and Sons, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17.J. Knoop, O. Rtithing, and B. Steffen. Optimal code motion: Theory and practice. ACM Transactions on Programming Languages and Systems, 16(4):1111-1155, July 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18.S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 19.W. D. Pauw and G. Sevitski. Visualizing reference patterns for solving memory leadcs in java. In ECOOP'99, pages 116-134, Lisbon, Portugad, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 20.S. Porat, B. Mendelson, and I. Shapira. Sharpening global static amadysis to cope with java. In CASCON, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 21.N. Rojemo amd C. Runcimam. Lag, drag, void amd use heap profiling and space-efficient compilation revisited. In Proceedings of the 1996 ACM SIGPLAN Int. Conf. on Func. Prog., pages 34-41, Philadelphia, Pennsylvania, 24 26 May 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 22.M. Sagiv, T. Reps, amd S. Horwitz. Precise interprocedurad datafiow analysis with applications to constamt propagation. Theor. Comp. Sci., 167:131-170, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 23.M. Serramo amd H.-J. Boehm. Understanding memory allocation of scheme progrmns. In Intertional Conference on Functional Programming, pages 245-256, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 24.R. Shadmm, E. K. Kolodner, and M. Sagiv. Automatic removed of array memory leodrs in java. In Int. Conf. on Comp. Construct. Springer, Apr. 2000.]]Google ScholarGoogle Scholar
  25. 25.R. Shadmm, E. K. Kolodner, amd M. Sagiv. On the effectiveness of GC in java. In Int. Symp. on Memory Management. ACM, Oct. 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 26.SPECjvm98. Standard Performance Evaluation Corporation (SPEC), Fairfax, VA, 1998. Available at http://www.spec.org/osg/j vm98/.]]Google ScholarGoogle Scholar
  27. 27.J. Whadey and M. Rinard. Compositional pointer amd escape analysis for java progrmns. In Conf. on Object-Oriented Prog. Syst., Lang. and Appl., 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. 28.P. R. Wilson. Uniprocessor garbage collection techniques. In Memory Management, International Workshop IWMM, Sept. 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Heap profiling for space-efficient Java

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            PLDI '01: Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation
            June 2001
            331 pages
            ISBN:1581134142
            DOI:10.1145/378795

            Copyright © 2001 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 1 May 2001

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • Article

            Acceptance Rates

            PLDI '01 Paper Acceptance Rate30of144submissions,21%Overall Acceptance Rate406of2,067submissions,20%

            Upcoming Conference

            PLDI '24

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader