Reuse, recycle to de-bloat software

  • Authors:
  • Suparna Bhattacharya;Mangala Gowri Nanda;K. Gopinath;Manish Gupta

  • Affiliations:
  • Indian Institute of Science;IBM Research;Indian Institute of Science;IBM Research

  • Venue:
  • Proceedings of the 25th European conference on Object-oriented programming
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

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.