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.
- 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 Scholar
- Garbage collector ergonomics. Available at http://download.oracle.com/javase/6/docs/technotes/guides/vm/gc-ergonomics.html.Google Scholar
- getrusage(3c) - solaris man page. Available at http://download.oracle.com/docs/cd/E19963-01/821-1465/getrusage-3c/index.html.Google Scholar
- proc(5) - process info pseudo-filesystem - Linux man page. Available at http://linux.die.net/man/5/proc.Google Scholar
- Tuning the memory management system. Available at http://download.oracle.com/docs/cd/E15289_01/doc.40/e15060/memman.htm#i1092162.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- A. W. Appel. Simple generational garbage collection and fast allocation. Software: Practice and Experience, 19(2):171--183, 1989. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- H. D. Baecker. Garbage collection for virtual memory computer systems. Communications of the ACM, 15(11):981--986, Nov. 1972. Google Scholar
Digital Library
- H. G. Baker. List processing in real-time on a serial computer. Communications of the ACM, 21(4):280--294, 1978. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- H.-J. Boehm and M. Weiser. Garbage collection in an uncooperative environment. Software: Practice and Experience, 18(9):807--820, Sept. 1988. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- C. J. Cheney. A non-recursive list compacting algorithm. Communications of the ACM, 13(11):677--678, Nov. 1970. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- S. Jiang and X. Zhang. TPF: a dynamic system thrashing protection facility. Software Practice and Experience, 32(3), 2002. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Mono Project. Mono. Available at http://www.mono-project.com/.Google Scholar
- 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 Scholar
Digital Library
- J. H. Reppy. A high-performance garbage collector for Standard ML. Technical memorandum, AT&T Bell Laboratories, Murray Hill, NJ, Dec. 1993.Google Scholar
- 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 Scholar
Digital Library
- Y. Smaragdakis, S. Kaplan, and P. Wilson. The EELRU adaptive replacement algorithm. Perform. Eval., 53(2):93--123, 2003. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Standard Performance Evaluation Corporation. Specjbb2000. Available at http://www.spec.org/jbb2000/docs/userguide.html.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Wikipedia. procfs -- Wikipedia, the free encyclopedia, 2011. {Online; accessed 1-Feb-2011}.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Waste not, want not: resource-based garbage collection in a shared environment
Recommendations
Program-level adaptive memory management
ISMM '06: Proceedings of the 5th international symposium on Memory managementMost application's performance is impacted by the amount of available memory. In a traditional application, which has a fixed working set size, increasing memory has a beneficial effect up until the application's working set is met. In the presence of ...
Garbage collection without paging
PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementationGarbage collection offers numerous software engineering advantages, but interacts poorly with virtual memory managers. Existing garbage collectors require far more pages than the application's working set and touch pages without regard to which ones are ...
Waste not, want not: resource-based garbage collection in a shared environment
ISMM '11: Proceedings of the international symposium on Memory managementTo 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, ...







Comments