skip to main content
article
Free Access

Controlling garbage collection and heap growth to reduce the execution time of Java applications

Published:01 September 2006Publication History
Skip Abstract Section

Abstract

In systems that support garbage collection, a tension exists between collecting garbage too frequently and not collecting it frequently enough. Garbage collection that occurs too frequently may introduce unnecessary overheads at the risk of not collecting much garbage during each cycle. On the other hand, collecting garbage too infrequently can result in applications that execute with a large amount of virtual memory (i.e., with a large footprint) and suffer from increased execution times due to paging.In this article, we use a large set of Java applications and the highly tuned and widely used Boehm-Demers-Weiser (BDW) conservative mark-and-sweep garbage collector to experimentally examine the extent to which the frequency of garbage collection impacts an application's execution time, footprint, and pause times. We use these results to devise some guidelines for controlling garbage collection and heap growth in a conservative garbage collector in order to minimize application execution times. Then we describe new strategies for controlling garbage collection and heap growth that impact not only the frequency with which garbage collection occurs but also the points at which it occurs. Experimental results demonstrate that when compared with the existing approach used in the standard BDW collector, our new strategy can significantly reduce application execution times.Our goal is to obtain a better understanding of how to control garbage collection and heap growth for an individual application executing in isolation. These results can be applied in a number of high-performance computing and server environments, in addition to some single-user environments. This work should also provide insights into how to make better decisions that impact garbage collection in multiprogrammed environments.

References

  1. Alonso, R. and Appel, A. W. 1990. Advisor for flexible working sets. In Proceedings of the ACM Sigmetrics Conference on Measurement and Modeling of Computer Systems (Boulder CO). ACM Press, 153--162. Google ScholarGoogle Scholar
  2. Andreasson, E., Hoffmann, F., and Lindholm, O. 2002. Memory management through machine learning: To collect or not to collect? In Usenix Java Virtual Machine Research and Technology Symposium (JVM) (San Fransisco, CA). Google ScholarGoogle Scholar
  3. Appel, A. 2003. Personal communication.Google ScholarGoogle Scholar
  4. Appel, A. W. 1989. Simple generational garbage collection and fast allocation. Softw. Pract. Exper. 19, 2, 171--183. Google ScholarGoogle Scholar
  5. Attanasio, C. R., Bacon, D. F., Cocchi, A., and Smith, S. 2001. A comparative evaluation of parallel garbage collectors. In Proceedings of the 14th Annual Workshop on Languages and Compilers for Parallel Computing (Cumberland Falls, KT). Lecture Notes in Computer Science Springer Verlag. Google ScholarGoogle Scholar
  6. Azatchi, H., Levanoni, Y., Paz, H., and Petrank, E. 2003. An on-the-fly mark-and-sweep garbage collector based on sliding view. In Proceedings of the (OOPSLA) ACM Conference on Object-Oriented Systems, Languages and Applications (Anaheim, CA). ACM SIGPLAN Notices. Google ScholarGoogle Scholar
  7. Bacon, D. F., Attanasio, C. R., Lee, H. B., Rajan, V. T., and Smith, S. 2001. Java without the coffee breaks: A nonintrusive multiprocessor garbage collector. In Proceedings of the SIGPLAN Conference on Programming Languages Design and Implementation (Snowbird, UT). ACM SIGPLAN Notices. Google ScholarGoogle Scholar
  8. Barabash, K., Ossia, Y., and Petrank, E. 2003. Mostly concurrent garbage collection revisited. In Proceedings of the (OOPSLA) ACM Conference on Object-Oriented Systems, Languages and Applications (Anaheim, CA). ACM SIGPLAN Notices. Google ScholarGoogle Scholar
  9. Boehm, H.-J. 2000. Reducing garbage collector cache misses. In Proceedings of the 2nd International Symposium on Memory Management (Minneapolis, MN), T. Hosking, Ed. ACM SIGPLAN Notices 36, 1. Google ScholarGoogle Scholar
  10. Boehm, H.-J. 2004. A garbage collector for C and C++. Hans Boehm's Web page for his garbage collector, http://www.hpl.hp.com/personal/Hans_Boehm/gc/.Google ScholarGoogle Scholar
  11. Boehm, H.-J. and Weiser, M. 1988. Garbage collection in an uncooperative environment. Softw. Pract. Exper. 18, 9, 807--820. Google ScholarGoogle Scholar
  12. Chilimbi, T. M. and Larus, J. R. 1998. Using generational garbage collection to implement cache-conscious data placement. In Proceedings of the 1st International Symposium on Memory Management (Vancouver, BC), R. Jones, Ed. ACM SIGPLAN Notices 34, 3, 37--48. Google ScholarGoogle Scholar
  13. Cooper, E., Nettles, S., and Subramanian, I. 1992. Improving the performance of SML garbage collection using application-specific virtual memory management. In Conference Record of the ACM Symposium on Lisp and Functional Programming (San Fransisco, CA). ACM Press, 43--52. Google ScholarGoogle Scholar
  14. Dimpsey, R., Arora, R., and Kuiper, K. 2000. Java server performance: A case study of building efficient, scalable JVMs. IBM Syst. J. 39, 1, 151--174. Google ScholarGoogle Scholar
  15. Domani, T., Kolodner, E., and Petrank, E. 2000. A generational on-the-fly garbage collector for Java. In Proceedings of SIGPLAN Conference on Programming Languages Design and Implementation (Vancouver, BC). ACM SIGPLAN Notices. Google ScholarGoogle Scholar
  16. Fitzgerald, R. and Tarditi, D. 2000. The case for profile-directed selection of garbage collectors. In Proceedings of the 2nd International Symposium on Memory Management (Minneapolis, MN) T. Hosking, Ed. ACM SIGPLAN Notices 36, 1. Google ScholarGoogle Scholar
  17. Geodesic Systems, Inc. 2002. REMIDI. Geodesic Systems, Inc. http://www.geodesic.com/solutions/remidi.html.Google ScholarGoogle Scholar
  18. Grunwald, D., Zorn, B., and Henderson, R. 1993. Improving the cache locality of memory allocation. In Proceedings of the SIGPLAN Conference on Programming Languages Design and Implementation (Albuquerque, NM). ACM SIGPLAN Notices 28, 6, 177--186. Google ScholarGoogle Scholar
  19. Jones, R. E. and Lins, R. 1996. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. Wiley Somerset, NJ. Google ScholarGoogle Scholar
  20. Kim, T., Chang, N., and Shin, H. 2000. Bounding worst case garbage collection time for embedded real-time systems. In Proceedings of the 6th IEEE Real Time Technology and Applications Symposium (RTAS). Google ScholarGoogle Scholar
  21. Moon, D. A. 1984. Garbage collection in a large LISP system. In Conference Record of the ACM Symposium on Lisp and Functional Programming (Austin, TX), G. L. Steele, Ed. ACM Press, 235--245. Google ScholarGoogle Scholar
  22. Ossia, Y., Ben-Yitzhak, O., Goft, I., Kolodner, E. K., Leikehman, V., and Owshanko, A. 2002. A parallel, incremental and concurrent GC for servers. In Proceedings of SIGPLAN Conference on Programming Languages Design and Implementation (Berlin, Germany). ACM SIGPLAN Notices 129--140. Google ScholarGoogle Scholar
  23. Printezis, T. 2001. Hot-Swapping between a mark-and-sweep and a mark-and-compact garbage collector in a generational environment. In Proceedings of the Java Virtual Machine Research and Technology Symposium. USENIX. Google ScholarGoogle Scholar
  24. Shaham, R., Kolodner, E. K., and Sagiv, M. 2000. On the effectiveness of GC in Java. In ISMM Proceedings of the 2nd International Symposium on Memory Management (Minneapolis, MN), T. Hosking, Ed. ACM SIGPLAN Notices 36, 1. Google ScholarGoogle Scholar
  25. Shuf, Y., Serrano, M., Gupta, M., and Singh, J. P. 2001. Characterizing the memory behavior of Java workloads: A structured view and opportunities for optimizations. In Proceedings of the SIGMETRICS Conference. Google ScholarGoogle Scholar
  26. Sun Microsystems. 2005. Tuning garbage collection with the 5.0 Java virtual machine. http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html.Google ScholarGoogle Scholar
  27. Smith, F. and Morrisett, G. 1998. Comparing mostly-copying and mark-sweep conservative collection. In Proceedings of the 1st International Symposium on Memory Management (Vancouver, BC), R. Jones, Ed. ACM SIGPLAN Notices 34, 3, 68--78. Google ScholarGoogle Scholar
  28. Ungar, D. M. and Jackson, F. 1988. Tenuring policies for generation-based storage reclamation. ACM SIGPLAN Notices 23, 11, 1--17. Google ScholarGoogle Scholar
  29. Ungar, D. M. and Jackson, F. 1992. An adaptive tenuring policy for generation scavengers. ACM Trans. Program. Lang. Syst. 14, 1, 1--27. Google ScholarGoogle Scholar
  30. Wilson, P. R. 1994. Uniprocessor garbage collection techniques. Tech. Rep., University of Texas.Google ScholarGoogle Scholar
  31. Wilson, P. R., Johnstone, M. S., Neely, M., and Boles, D. 1995. Dynamic storage allocation: A survey and critical review. In Proceedings of the International Workshop on Memory Management (Kinross, Scotland), H. Baker, Ed. Lecture Notes in Computer Science, vol. 986. Springer Verlag. Google ScholarGoogle Scholar
  32. Wilson, P. R., Lam, M. S., and Moher, T. G. 1991. Effective static-graph reorganization to improve locality in garbage collected systems. ACM SIGPLAN Notices 26, 6, 177--191. Google ScholarGoogle Scholar
  33. Wilson, P. R., Lam, M. S., and Moher, T. G. 1992. Caching considerations for generational garbage collection. In Conference Record of the ACM Symposium on Lisp and Functional Programming (San Fransisco, CA). ACM Press, 32--42. Google ScholarGoogle Scholar
  34. Zorn, B. 1990. Comparing mark-and-sweep and stop-and-copy garbage collection. In Conference Record of the ACM Symposium on Lisp and Functional Programming (Nice, France). ACM Press. Google ScholarGoogle Scholar
  35. Zorn, B. 1991. The effect of garbage collection on cache performance. Tech. Rep. CU-CS-528-91, University of Colorado at Boulder.Google ScholarGoogle Scholar
  36. Zorn, B. 1993. The measured cost of conservative garbage collection. Softw. Pract. Exper. 23, 733--756. Google ScholarGoogle Scholar

Index Terms

  1. Controlling garbage collection and heap growth to reduce the execution time of Java applications

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

Full Access

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader
About Cookies On This Site

We use cookies to ensure that we give you the best experience on our website.

Learn more

Got it!