Skip to main content

Exploiting Java Objects Behavior for Memory Management and Optimizations

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3302))

Abstract

We study the behavior of Java objects in order to explore potential garbage collection optimization opportunities in Java programs. Our study has led to one probable strategy for using heap buffers effectively through obtaining liveness and type information of objects. To allow examination of the Java memory, we implement a heap profiling tool by instrumenting an existing Java virtual machine. The tool records useful object events during program execution, and groups the objects according to their types. We apply the tool to different benchmarks and analyze the results. We also try to characterize the objects’ behaviors and suggest that memory occupied by certain objects can be reused by other objects, leading to improved performance of the program. We implement a simple prototype to demonstrate the feasibility of the object reuse approach.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Acar, U.A., Blelloch, G.E., Harper, R.: Selective Memoization. In: Proceedings of the 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, New Orleans, Louisiana, USA, pp. 14–25. ACM, New York (2003)

    Chapter  Google Scholar 

  2. Alpern, B., Attanasio, C.R., Barton, J.J., Burke, M.G., Cheng, P., Choi, J.-D., Cocchi, A., Fink, S.J., Grove, D., Hind, M., Hummel, S.F., Lieber, D., Litvinov, V., Mergen, M.F., Ngo, T., Russell, J.R., Sarkar, V., Serrano, M.J., Shepherd, J.C., Smith, S.E., Sreedhar, V.C., Srinivasan, H., Whaley, J.: The Jalapeño Virtual Machine. IBM System Journal 39(1) (2000)

    Google Scholar 

  3. Appel, A.W., Gonçalves, M.J.R.: Hash-consing Garbage Collection. Technical Report CS-TR-412-93, Princeton University (1993)

    Google Scholar 

  4. Bellman, R.: Dynamic Programming. Princeton University Press, Princeton (1957)

    MATH  Google Scholar 

  5. Berk, E.J., Ananian, C.S.: JLex: A Lexical Analyzer Generator for Java(TM), http://www.cs.princeton.edu/~appel/modern/java/JLex/

  6. Blackburn, S.M., Singhai, S., Hertz, M., McKinley, K.S., Moss, J.E.B.: Pretenuring for Java. In: Proceedings of the OOPSLA 2001 Conference on Object Oriented Programming Systems Languages and Applications, Tampa Bay, Florida, pp. 342–352. ACM Press, New York (2001)

    Google Scholar 

  7. Boehm, H.J.: GCBench, http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_bench/

  8. Bonwick, J.: The Slab Allocator: An Object-Caching Kernel Memory Allocator. USENIX Summer 1994 Technical Conference. Boston, Massachusetts, USA (1994)

    Google Scholar 

  9. Cahoon, B., McKinley, K.S.: Data Flow Analysis for Software Prefetching Linked Data Structures in Java. In: International Conference on Parallel Architectures and Compilation Techniques (PACT 2001), Barcelona, Spain (2001)

    Google Scholar 

  10. Cheney, C.J.: A Nonrecursive List Computing Algorithm. Commun. ACM 13(11), 677–678 (1970)

    Article  MATH  Google Scholar 

  11. Collins, G.E.: A Method For Overlapping and Erasure Of Lists. Commun. ACM 3(12), 655–657 (1960)

    Article  MathSciNet  Google Scholar 

  12. Davis, T.E.: Build Your Own ObjectPool in Java to Boost App Speed: Increase the Speed of Your Applications while Reducing Memory Requirements (1998), http://www.javaworld.com/javaworld/jw-06-/jw-06-object-pool.html

  13. Dieckmann, S., Hölzle, U.: A Study of the Allocation Behavior of the SPECjvm98 Java Benchmarks. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 92–115. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  14. Ershov, A.P.: On Programming of Arithmetic Operations. Commun. ACM 1(8), 3–6 (1958)

    Article  MATH  Google Scholar 

  15. Fenichel, R.R., Yochelson, J.C.: A Lisp Garbage-Collector for Virtual-Memory Computer Systems. Commun. ACM 12(11), 611–612 (1969)

    Article  MATH  Google Scholar 

  16. Fitzgerald, R., Tarditi, D.: The Case for Profile-Directed Selection of Garbage Collectors. In: Proceedings of the 2nd International Symposium on Memory Management, Minneapolis, Minnesota, pp. 111–120. ACM Press, New York (2000)

    Google Scholar 

  17. Goto, E.: Monocopy and Associative Algorithms in an Extended Lisp. Technical Report 74-03, Information Science Laboratory, University of Tokyo, Tokyo, Japan (May 1974)

    Google Scholar 

  18. Hirzel, M., Diwan, A., Hosking, A.: On the Usefulness of Liveness for Garbage Collection and Leak Detection. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 181–206. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  19. Hirzel, M., Diwan, A., Henkel, J.: On the Usefulness of Type and Liveness Accuracy for Garbage Collection and Leak Detection. ACM Transactions on Programming Languages and Systems 24(6), 593–624 (2002)

    Article  Google Scholar 

  20. Hudson, S.E., Flannery, F., Ananian, C.S.: CUP Parser Generator for Java, http://www.cs.princeton.edu/~appel/modern/java/CUP/

  21. Hudson, S.E.: JFlex—The Fast Scanner Generator for Java, http://jflex.de/

  22. Jones, R., Lins, R.: Garbage Collection: Algorithms for Automatic Dynamic Memory Management. John Wiley & Sons Ltd., Chichester (1996)

    MATH  Google Scholar 

  23. Kim, J.-S., Hsu, Y.: Memory System Behavior of Java Programs: Methodology and Analysis. ACM SIGMETRICS Performance Evaluation Review 28(1), 264–274 (2000)

    Article  Google Scholar 

  24. Lieberman, H., Hewitt, C.: A Real-Time Garbage Collector Based on the Lifetimes of Objects. Commun. ACM 26(6), 419–429 (1983)

    Article  Google Scholar 

  25. Marinov, D., O’Callahan, R.: Object Equality Profiling. In: Proceedings of the Conference on Object-Oriented Programming, Systems, Languages, and Applications, Anaheim, California, USA, pp. 313–325. ACM Press, New York (2003)

    Google Scholar 

  26. McCarthy, J.: Recursive Functions Symbolic Expressions and Their Computation by Machine. Part I. Commun. ACM 3(4), 184–195 (1960)

    Article  MATH  Google Scholar 

  27. Michie, D.: Memo Functions and Machine Learning. Nature 218 (April 1968)

    Google Scholar 

  28. Pugh, W.: An Improved Replacement Strategy for Function Caching. In: Proceedings of the 1988 ACM Conference on LISP and Functional Programming, Snowbird, Utah, USA, pp. 269–276. ACM Press, New York (1988)

    Chapter  Google Scholar 

  29. Shaham, R., Kolodner, E.K., Sagiv, M.: On the Effectiveness of GC in Java. In: Proceedings of the 2nd International Symposium on Memory Management, Minneapolis, Minnesota, USA, pp. 12–17. ACM Press, New York (2000)

    Google Scholar 

  30. Shaham, R., Kolodner, E.K., Sagiv, M.: Heap Profiling for Space-Efficient Java. In: Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, pp. 104–113. ACM Press, Snowbird (2001)

    Chapter  Google Scholar 

  31. Shaham, R., Kolodner, E.K., Sagiv, M.: Estimating the Impact of Heap Liveness Information on Space Consumption in Java. In: Proceedings of the 3rd International Symposium on Memory Management, Berlin, Germany, pp. 64–75. ACM, New York (2002)

    Google Scholar 

  32. Shuf, Y., Serrano, M.J., Gupta, M., Singh, J.P.: Characterizing the Memory Behavior of Java Workloads: A Structured View and Opportunities for Optimizations. In: Proceedings of the 2001 ACM SIGMETRICS International Conference on Measurement and Modeling of Computer Systems, Cambridge, Massachusetts, pp. 194–205. ACM, New York (2001)

    Chapter  Google Scholar 

  33. Shuf, Y., Gupta, M., Bordawekar, R., Singh, J.P.: Exploiting Prolific Types for Memory Management and Optimizations. In: Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Portland, Oregon, USA, pp. 295–306. ACM Press, New York (2002)

    Google Scholar 

  34. Standard Performance Evaluation Corporation: SPEC JVM98 Benchmarks, http://www.specbench.org/osg/jvm98/

  35. Yang, Q., Srisa-an, W., Skotiniotis, T., Chang, J.M.: Java Virtual Machine Timing Probes: A Study of Object Life Span and Garbage Collection. In: Proceedings of 21st IEEE International Performance, Computing, and Communications Conference, Phoenix, Arizona (2002)

    Google Scholar 

  36. Ungar, D.: Generation Scavenging: A Non-Disruptive High Performance Storage Reclamation Algorithm. In: Proceedings of the 1st ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, pp. 157–167 (1984)

    Google Scholar 

  37. Wilson, P.R., Johnstone, M.S., Neely, M., Boles, D.: Dynamic Storage Allocation: A Survey and Critical Review. In: Baker, H.G. (ed.) IWMM-GIAE 1995. LNCS, vol. 986, pp. 1–116. Springer, Heidelberg (1995)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Yu, Z.C.H., Lau, F.C.M., Wang, CL. (2004). Exploiting Java Objects Behavior for Memory Management and Optimizations. In: Chin, WN. (eds) Programming Languages and Systems. APLAS 2004. Lecture Notes in Computer Science, vol 3302. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30477-7_29

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-30477-7_29

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-23724-2

  • Online ISBN: 978-3-540-30477-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics