Abstract
Most Java programmers would agree that Java is a language that promotes a philosophy of “create and go forth”. By design, temporary objects are meant to be created on the heap, possibly used and then abandoned to be collected by the garbage collector. Excessive generation of temporary objects is termed “object churn” and is a form of software bloat that often leads to performance and memory problems. To mitigate this problem, many compiler optimizations aim at identifying objects that may be allocated on the stack. However, most such optimizations miss large opportunities for memory reuse when dealing with objects inside loops or when dealing with container objects.
In this paper, we describe a novel algorithm that detects bloat caused by the creation of temporary container and String objects within a loop. Our analysis determines which objects created within a loop can be reused. Then we describe a source-to-source transformation that efficiently reuses such objects. Empirical evaluation indicates that our solution can reduce upto 40% of temporary object allocations in large programs, resulting in a performance improvement that can be as high as a 20% reduction in the run time, specifically when a program has a high churn rate or when the program is memory intensive and needs to run the GC often.
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Mitchell, N., Schonberg, E., Sevitsky, G.: Four trends leading to java runtime bloat. IEEE Software 27(1), 56–63 (2010)
Xu, G., Mitchell, N., Arnold, M., Rountev, A., Sevitsky, G.: Software bloat analysis: Finding, removing, and preventing performance problems in modern large-scale object-oriented applications. In: Future of Software Engineering Research (2010)
Shirazi, J.: Java performance tuning. O’Reilly, Sebastopol (2003)
Blackburn, S., et al.: The DaCapo benchmarks: Java benchmarking development and analysis. In: Object-Oriented Programming, Systems, Languages and Applications, OOPSLA (2006)
Nanda, M.G., Sinha, S.: Accurate interprocedural null-dereference analysis for Java. In: Proc. of the 31st Intl. Conf. on Softw., pp. 133–143 (2009)
Zhao, Y., Shi, J., Zheng, K., Wang, H., Lin, H., Shao, L.: Allocation wall: a limiting factor of java applications on emerging multi-core platforms. In: Object-Oriented Programming, Systems, Languages and Applications, OOPSLA (2009)
Shankar, A., Arnold, M., Bodik, R.: Jolt: lightweight dynamic analysis and removal of object churn. In: Object-Oriented Programming, Systems, Languages and Applications, OOPSLA (2008)
Guyer, S., McKinley, K., Frampton, D.: Free-me: A static analysis for automatic individual object reclamation. In: Programming Language Design and Implementation, PLDI (2006)
Choi, J.-D., Gupta, M., Serrano, M., Sreedhar, V.C., Midkiff, S.: Escape analysis for java. SIGPLAN Not. 34(10), 1–19 (1999)
Blanchet, B.: Escape analysis for object-oriented languages: application to java. SIGPLAN Not. 34(10), 20–34 (1999)
Gay, D., Steensgaard, B.: Fast escape analysis and stack allocation for object-based programs. In: International Conference on Compiler Construction (2000)
Whaley, J., Rinard, M.: Compositional pointer and escape analysis for java programs. SIGPLAN Not. 34(10), 187–206 (1999)
Bacon, D.F., Cheng, P., Rajan, V.T.: A unified theory of garbage collection. SIGPLAN Not. 39(10), 50–68 (2004)
Dufour, B., Ryder, B.G., Sevitsky, G.: A scalable technique for characterizing the usage of temporaries in framework-intensive java applications. In: SIGSOFT 2008/FSE-16, pp. 59–70 (2008)
Buytaert, D., Beyls, K., De Bosschere, K.: Hinting refactorings to reduce object creation in java. In: ACES, pp. 73–76 (2005)
Xian, F., Srisa-an, W., Jiang, H.: Microphase: an approach to proactively invoking garbage collection for improved performance. In: Object-Oriented Programming, Systems, Languages and Applications, OOPSLA (2007)
Cherem, S., Rugina, R.: Uniqueness inference for compile-time object deallocation. In: ISMM (2007)
Inoue, H., Komatsu, H., Nakatani, T.: A study of memory management for web-based applications on multicore processors. In: Programming Language Design and Implementation, PLDI (2009)
Mitchell, N., Srinivasan, H.: Modeling runtime behavior in framework-based applications. In: Hu, Q. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 429–451. Springer, Heidelberg (2006)
Mitchell, N., Sevitsky, G.: The causes of bloat, the limits of health. In: Object-Oriented Programming, Systems, Languages and Applications, OOPSLA (2007)
Mitchell, N., Schonberg, E., Sevitsky, G.: Making sense of large heaps. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 77–97. Springer, Heidelberg (2009)
Xu, G., Arnold, M., Mitchell, N., Rountev, A., Sevitsky, G.: Go with the flow: profiling copies to find runtime bloat. In: Programming Language Design and Implementation, PLDI (2010)
Xu, G., et al.: Finding low-utility data structures. In: Programming Language Design and Implementation, PLDI (2010)
Xu, G., Rountev, A.: Detecting inefficiently-used containers to avoid bloat. In: Programming Language Design and Implementation, PLDI (2010)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bhattacharya, S., Nanda, M.G., Gopinath, K., Gupta, M. (2011). Reuse, Recycle to De-bloat Software. In: Mezini, M. (eds) ECOOP 2011 – Object-Oriented Programming. ECOOP 2011. Lecture Notes in Computer Science, vol 6813. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22655-7_19
Download citation
DOI: https://doi.org/10.1007/978-3-642-22655-7_19
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-22654-0
Online ISBN: 978-3-642-22655-7
eBook Packages: Computer ScienceComputer Science (R0)