Offline GC: trashing reachable objects on tiny devices

The ability of tiny embedded devices to run large and feature-rich Java programs is typically constrained by the amount of memory installed on those devices. Furthermore, the useful operation of such devices in a wireless sensor application is limited by their battery life. We propose a garbage collection (GC) scheme called Offline GC which alleviates both these limitations. Our approach defies the current practice in which an object may be deallocated only if it is unreachable. Offline GC allows freeing an object that is still reachable but is guaranteed not to be used again in the program. Furthermore, it may deallocate an object inside a function, a loop or a block where it is last used, even if that object is assigned to a global field. This leads to a larger amount of memory available to a program. Based on an inter-procedural and field-sensitive data flow analysis we identify, during program compilation, the point at which an object can safely be deallocated at runtime. We have designed three algorithms for the purpose of making these offline deallocation decisions. Our implementation of Offline GC indicates a significant reduction in the amount of RAM and the number of CPU cycles needed to run a variety of benchmark programs. Offline GC is shown to increase the average amount of RAM available to a program by up to 82% compared to a typical online garbage collector. Furthermore, the number of CPU cycles consumed in freeing the memory is reduced by up to 94% when Offline GC is used.

[1]  Jeffrey M. Barth Shifting garbage collection overhead to compile time , 1977, CACM.

[2]  Neil D. Jones,et al.  Flow analysis and optimization of LISP-like structures , 1979, POPL.

[3]  Escape Analysis for Java. Theory and Practice , 2003 .

[4]  Sigmund Cherem,et al.  Region analysis and transformation for Java programs , 2004, ISMM '04.

[5]  Gidon Ernst,et al.  Optimized Java Binary and Virtual Machine for Tiny Motes , 2010, DCOSS.

[6]  Kathryn S. McKinley,et al.  Free-Me: a static analysis for automatic individual object reclamation , 2006, PLDI '06.

[7]  Elvira Albert,et al.  Heap space analysis for java bytecode , 2007, ISMM '07.

[8]  David Detlefs,et al.  Garbage collection and local variable type-precision and liveness in Java virtual machines , 1998, PLDI.

[9]  Ian F. Akyildiz,et al.  Wireless sensor networks , 2007 .

[10]  Wolfram Schulte,et al.  Deriving Residual Reference Count Garbage Collectors , 1994, PLILP.

[11]  Pramod G. Joisha Overlooking roots: a framework for making nondeferred reference-counting garbage collection fast , 2007, ISMM '07.

[12]  Sigmund Cherem,et al.  Uniqueness inference for compile-time object deallocation , 2007, ISMM '07.

[13]  Eran Yahav,et al.  Establishing local temporal heap safety properties with applications to compile-time memory management , 2003, Sci. Comput. Program..

[14]  Bruno Blanchet,et al.  Escape analysis for JavaTM: Theory and practice , 2003, TOPL.

[15]  Rafael Dueire Lins,et al.  Garbage collection: algorithms for automatic dynamic memory management , 1996 .

[16]  Peter I. Corke,et al.  Darjeeling, a feature-rich VM for the resource poor , 2009, SenSys '09.

[17]  Jens Palsberg,et al.  Avrora: scalable sensor network simulation with precise timing , 2005, IPSN 2005. Fourth International Symposium on Information Processing in Sensor Networks, 2005..

[18]  Yanping Wang,et al.  SPECjvm2008 Performance Characterization , 2009, SPEC Benchmark Workshop.

[19]  David Gay,et al.  Memory management with explicit regions , 1998, PLDI.

[20]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[21]  Sigmund Cherem,et al.  Compile-time deallocation of individual objects , 2006, ISMM '06.

[22]  Florin Craciun,et al.  A Flow-Sensitive Region Inference for CLI , 2008, APLAS.

[23]  James Cheney,et al.  Region-based memory management in cyclone , 2002, PLDI '02.

[24]  David F. Bacon,et al.  Garbage collection for embedded systems , 2004, EMSOFT '04.

[25]  Jong-Deok Choi,et al.  Escape analysis for Java , 1999, OOPSLA '99.

[26]  Guy E. Blelloch,et al.  Using page residency to balance tradeoffs in tracing garbage collection , 2005, VEE '05.

[27]  Philip Levis,et al.  Collection tree protocol , 2009, SenSys '09.