Abstract
This paper shows that Appel-style garbage collectors often make suboptimal decisions both in terms of when and how to collect. We argue that garbage collection should be done when the amount of live bytes is low (in order to minimize the collection cost) and when the amount of dead objects is high (in order to maximize the available heap size after collection). In addition, we observe that Appel-style collectors sometimes trigger a nursery collection in cases where a full-heap collection would have been better.
Based on these observations, we propose garbage collection hints (GCH) which is a profile-directed method for guiding garbage collection. Offline profiling is used to identify favorable collection points in the program code. In those favorable collection points, the VM dynamically chooses between nursery and full-heap collections based on an analytical garbage collector cost-benefit model. By doing so, GCH guides the collector in terms of when and how to collect. Experimental results using the SPECjvm98 benchmarks and two generational garbage collectors show that substantial reductions can be obtained in garbage collection time (up to 30X) and that the overall execution time can be reduced by more than 10%.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Blackburn, S.M., Cheng, P., McKinely, K.S.: Myths and realities: the performance impact of garbage collection. In: Proceedings of SIGMETRICS 2004. ACM, New York (2004)
Appel, A.W.: Simple generational garbage collection and fast allocation. Software practices and experience 19, 171–183 (1989)
Blackburn, S.M., Cheng, P., McKinley., K.S.: Oil and water? High performance garbage collection in Java with JMTk. In: Proceedings of ICSE 2004, pp. 137–146 (2004)
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\(\tilde{\text{n}}\)o Virtual Machine. IBM Systems Journal 39, 211–238 (2000)
Browne, S., Dongarra, J., Garner, N., Ho, G., Mucci, P.: A portable programming interface for performance evaluation on modern processors. The international journal of high performance computing applications 14, 189–204 (2000)
Hertz, M., Blackburn, S.M., Moss, J.E.B., McKinley, K.S., Stefanovic, D.: Error free garbage collection traces: how to cheat and not get caught. In: Proceedings of SIGMETRICS 2002, pp. 140–151. ACM, New York (2002)
Boehm, H., Weiser, M.: Garbage collection in an uncooperative environment. Software practices and experience 18, 807–820 (1988)
Brecht, T., Arjomandi, E., Li, C., Pham, H.: Controlling garbage collection and heap growth to reduce the execution time of Java applications. In: Proceedings of OOPSLA 2001, pp. 353–366. ACM, New York (2001)
Wilson, P.R., Moher, T.G.: Design of the opportunistic garbage collector. In: Proceedings of OOPSLA 1989, pp. 23–35. ACM, New York (1989)
Ding, C., Zhang, C., Shen, X., Ogihara, M.: Gated memory control for memory monitoring, leak detection and garbage collection. In: Proceedings of MSP 2005, pp. 62–67. ACM, New York (2005)
Detlefs, D., Flood, C., Heller, S., Printezis, T.: Garbage-first garbage collection. In: Proceedings of ISMM 2004, pp. 37–48. ACM, New York (2004)
Velasco, J.M., Olcoz, K., Tirado, F.: Adaptive tuning of reserved space in an Appel collector. In: ECOOP 2004, pp. 543–559. ACM, New York (2004)
Stefanovic, D., Hertz, M., Blackburn, S.M., McKinley, K.S., Moss, J.E.B.: Older-first garbage collection in practice: evaluation in a Java virtual machine. In: Proceedings of MSP 2002, pp. 25–36. ACM, New York (2002)
Andreasson, E., Hoffmann, F., Lindholm, O.: Memory management through machine learning: to collect or not to collect? In: Proceedings of JVM 2002. USENIX (2002)
Printezis, T.: Hot-swapping between a mark&sweep and a mark&compact garbage collector in a generational environment. In: Proceedings of JVM 2001. USENIX (2001)
Soman, S., Krintz, C., Bacon, D.F.: Dynamic selection of application-specific garbage collectors. In: Proceedings of ISMM 2004, pp. 49–60. ACM, New York (2004)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Buytaert, D., Venstermans, K., Eeckhout, L., De Bosschere, K. (2005). Garbage Collection Hints. In: Conte, T., Navarro, N., Hwu, Wm.W., Valero, M., Ungerer, T. (eds) High Performance Embedded Architectures and Compilers. HiPEAC 2005. Lecture Notes in Computer Science, vol 3793. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11587514_16
Download citation
DOI: https://doi.org/10.1007/11587514_16
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-30317-6
Online ISBN: 978-3-540-32272-6
eBook Packages: Computer ScienceComputer Science (R0)