skip to main content
research-article

Waste not, want not: resource-based garbage collection in a shared environment

Published:04 June 2011Publication History
Skip Abstract Section

Abstract

To achieve optimal performance, garbage-collected applications must balance the sizes of their heaps dynamically. Sizing the heap too small can reduce throughput by increasing the number of garbage collections that must be performed. Too large a heap, however, can cause the system to page and drag down the overall throughput. In today's multicore, multiprocessor machines, multiple garbage-collected applications may run simultaneously. As a result, each virtual machine (VM) must adjust its memory demands to reflect not only the behavior of the application it is running, but also the behavior of the peer applications running on the system.

We present a memory management system that enables VMs to react to memory demands dynamically. Our approach allows the applications' heaps to remain small enough to avoid the negative impacts of paging, while still taking advantage of any memory that is available within the system. This memory manager, which we call Poor Richard's Memory Manager, focuses on optimizing overall system performance by allowing applications to share data and make system-wide decisions. We describe the design of our memory management system, show how it can be added to existing VMs with little effort, and document that it has almost no impact on performance when memory is plentiful. Using both homogenous and heterogenous Java workloads, we then show that Poor Richard's memory manager improves average performance by up to a factor 5.5 when the system is paging. We further show that this result is not specific to any garbage collection algorithm, but that this improvement is observed for every garbage collector on which we test it. We finally demonstrate the versatility of our memory manager by using it to improve the performance of a conservative whole-heap garbage collector used in executing .Net applications.

References

  1. Bug ID: 4694058 Allow JRE to return unused memory to the system heap. Available at http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4694058.Google ScholarGoogle Scholar
  2. Garbage collector ergonomics. Available at http://download.oracle.com/javase/6/docs/technotes/guides/vm/gc-ergonomics.html.Google ScholarGoogle Scholar
  3. getrusage(3c) - solaris man page. Available at http://download.oracle.com/docs/cd/E19963-01/821-1465/getrusage-3c/index.html.Google ScholarGoogle Scholar
  4. proc(5) - process info pseudo-filesystem - Linux man page. Available at http://linux.die.net/man/5/proc.Google ScholarGoogle Scholar
  5. Tuning the memory management system. Available at http://download.oracle.com/docs/cd/E15289_01/doc.40/e15060/memman.htm#i1092162.Google ScholarGoogle Scholar
  6. R. Alonso and A. W. Appel. An advisor for flexible working sets. In Proceedings of the 1990 Joint International Conference on Measurement and Modeling of Computer Systems, pages 153--162, Boulder, CO, May 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. E. Andreasson, F. Hoffmann, and O. Lindholm. To collect or not to collect? Machine learning for memory management. In JVM '02: Proceedings of the Java Virtual Machine Research and Technology Symposium, pages 27--39, August 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. W. Appel. Simple generational garbage collection and fast allocation. Software: Practice and Experience, 19(2):171--183, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. F. Bacon, P. Cheng, and V. T. Rajan. A real-time garbage collecor with low overhead and consistent utilization. In Thirtieth Annual ACM Symposium on Principles of Programming Languages, volume 38(1), pages 285--298, New Orleans, LA, Jan. 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. H. D. Baecker. Garbage collection for virtual memory computer systems. Communications of the ACM, 15(11):981--986, Nov. 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. H. G. Baker. List processing in real-time on a serial computer. Communications of the ACM, 21(4):280--294, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. P. B. Bishop. Computer Systems with a Very Large Address Space and Garbage Collection. PhD thesis, MIT Laboratory for Computer Science, Cambridge, MA, May 1977.Google ScholarGoogle Scholar
  13. S. M. Blackburn, P. Cheng, and K. S. McKinley. Myths and reality: The performance impact of garbage collection. In Proceedings of the 2004 Joint International Conference on Measurement and Modeling of Computer Systems, volume 32(1), pages 25--36, June 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. M. Blackburn, P. Cheng, and K. S. McKinley. Oil and water? high performance garbage collection in Java with MMTk. In Proceedings of the 26th International Conference on Software Engineering, pages 137--146, Edinburgh, Scotland, May 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khang, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In Proceedings of ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, volume 41(10), pages 169--190, Oct. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. S. M. Blackburn and K. S. McKinley. Immix: a mark-region garbage collector with space efficiency, fast collection, and mutator performance. In Proceedings of the 2008 ACM SIGPLAN conference on Programming language design and implementation, volume 43(6), pages 22--32, Tucson, AZ, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. G. Bobrow and D. L. Murphy. Structure of a LISP system using two-level storage. Communications of the ACM, 10(3):155--159, Mar. 1967. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. G. Bobrow and D. L. Murphy. A note on the efficiency of a LISP computation in a paged machine. Communications of the ACM, 11(8):558--560, Aug. 1968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. H.-J. Boehm and M. Weiser. Garbage collection in an uncooperative environment. Software: Practice and Experience, 18(9):807--820, Sept. 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. D. Buytaert, K. Venstermans, L. Eeckhout, and K. D. Bosschere. GCH: Hints for triggering garbage collections. In Transactions on High-Performance Embedded Architectures and Compilers I, pages 74--94. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. F. Chen, S. Jiang, and X. Zhang. CLOCK-Pro: an effective improvement of the CLOCK replacement. In Proceedings of USENIX Annual Technical Conference, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. C. J. Cheney. A non-recursive list compacting algorithm. Communications of the ACM, 13(11):677--678, Nov. 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. C. Ding, C. Zhang, X. Shen, and M. Ogihara. Gated memory control for memory monitoring, leak detection and garbage collection. In Proceedings of the ACM SIGPLAN Workshop on Memory System Performance, pages 62--67, Chicago, IL, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. L. Eeckhout, A. Georges, and K. D. Bosschere. How Java programs interact with virtual machines at the microarchitectural level. In Proceedings of the 18th ACM Conference on Object-Oriented Programming, Systems, Languages, & Applications, volume 38(11), pages 169--186, Anaheim, CA, Oct. 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. R. R. Fenichel and J. C. Yochelson. A Lisp garbage collector for virtual memory computer systems. Communications of the ACM, 12(11):611--612, Nov. 1969. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. C. Grzegorczyk, S. Soman, C. Krintz, and R. Wolski. Isla vista heap sizing: Using feedback to avoid paging. In Proceedings of the International Symposium on Code Generation and Optimization, pages 325--340, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Hertz, Y. Feng, and E. D. Berger. Garbage collection without paging. In Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2005), volume 40(7), pages 143--153, Chicago, IL, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Hertz, Y. Feng, and E. D. Berger. Garbage collection without paging. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 143--153, Chicago, IL, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. X. Huang, S. M. Blackburn, K. S. McKinley, J. E. B. Moss, Z. Wang, and P. Cheng. The garbage collection advantage: Improving program locality. In Proceedings of the 19th ACM Conference on Object-Oriented Programming, Systems, Languages, & Applications, volume 39(11), pages 69--80, Vancouver, BC, Canada, Oct. 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. S. Jiang and X. Zhang. TPF: a dynamic system thrashing protection facility. Software Practice and Experience, 32(3), 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. H. Lieberman and C. E. Hewitt. A real-time garbage collector based on the lifetimes of objects. Communications of the ACM, 26(6):419--429, June 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Mono Project. Mono. Available at http://www.mono-project.com/.Google ScholarGoogle Scholar
  33. D. A. Moon. Garbage collection in a large LISP system. In Conference Record of the 1994 ACM Symposium on Lisp and Functional Programming, pages 235--245, Austin, TX, Aug. 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. J. H. Reppy. A high-performance garbage collector for Standard ML. Technical memorandum, AT&T Bell Laboratories, Murray Hill, NJ, Dec. 1993.Google ScholarGoogle Scholar
  35. N. Sachindran and J. E. B. Moss. Mark-Copy: Fast copying GC with less space overhead. In Proceedings of the 18th ACM Conference on Object-Oriented Programming, Systems, Languages, & Applications, volume 38(11), pages 326--343, Anaheim, CA, Oct. 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Y. Smaragdakis, S. Kaplan, and P. Wilson. The EELRU adaptive replacement algorithm. Perform. Eval., 53(2):93--123, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. S. Soman, C. Krintz, and D. F. Bacon. Dynamic selection of application-specific garbage collectors. In Proceedings of the International Symposium on Memory Management, pages 49--60, Vancouver, BC, Canada, June 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Standard Performance Evaluation Corporation. Specjbb2000. Available at http://www.spec.org/jbb2000/docs/userguide.html.Google ScholarGoogle Scholar
  39. D. Ungar. Generation scavenging: A non-disruptive high performance storage reclamation algorithm. In Proceedings of the First ASM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, volume 19(9), pages 157--167, Apr. 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. M. Wegiel and C. Krintz. XMem: type-safe, transparent, shared memory for cross-runtime communication and coordination. In Proceedings of the 2008 ACM SIGPLAN Conference on Programming Language Design and Implementation, volume 43(6), pages 327--338, Tucson, AZ, June 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. M. Wegiel and C. Krintz. Dynamic prediction of collection yield for managed runtimes. In Proceeding of the 14th international conference on Architectural support for programming languages and operating systems, volume 44(3), pages 289--300, Washington, DC, Mar. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Wikipedia. procfs -- Wikipedia, the free encyclopedia, 2011. {Online; accessed 1-Feb-2011}.Google ScholarGoogle Scholar
  43. F. Xian, W. Seisa-an, and H. Jiang. MicroPhase: An approach to proactively invoking garbage collection for improved performance. In Proceedings of the 22nd ACM Conference on Object-Oriented Programming, Systems, Languages, & Applications, volume 42(10), pages 77--96, Montreal, Quebec, Canada, Oct. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. T. Yang, E. D. Berger, S. F. Kaplan, and J. E. B. Moss. CRAMM: virtual memory support for garbage-collected applications. In Proceedings of the Symposium on Operating Systems Design and Implementation, pages 103--116, Seattle, WA, Nov. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. T. Yang, M. Hertz, E. D. Berger, S. F. Kaplan, and J. E. B. Moss. Automatic heap sizing: taking real memory into account. In Proceedings of the International Symposium on Memory Management, pages 61--72, Vancouver, BC, Canada, June 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. C. Zhang, K. Kelsey, X. Shen, C. Ding, M. Hertz, and M. Ogihara. Program-level adaptive memory management. In Proceedings of the International Symposium on Memory Management, pages 174--183, Ottawa, ON, Canada, June 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Y. Zhang, A. Bestavros, M. Guirguis, I. Matta, and R. West. Friendly virtual machines: leveraging a feedback-control model for application adaptation. In Proceedings of the 1st ACM/USENIX international conference on Virtual execution environments, pages 2--12, Chicago, IL, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. P. Zhou, V. Pandey, J. Sundaresan, A. Raghuraman, Y. Zhou, and S. Kumar. Dynamic tracking of page miss ratio curve for memory management. In Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems, volume 39(11), pages 177--188, Boston, MA, Oct. 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Waste not, want not: resource-based garbage collection in a shared environment

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!