Free-Me: Explicit Memory Deallocation for Java
Modern programming languages such as Java and C# include automatic memory reclamation. The run-time systems for these languages use a garbage collector to identify unreachable objects and reclaim their memory. Garbage collection provides substantial software engineering benefits over explicit memory management, which is error-prone and notoriously difficult to debug. Recent research, however, has shown that explicit memory management performs significantly better than garbage collection when available memory is limited. It appears that in such situations the garbage collector runs very frequently, while only recovering a small amount of memory in each collection.
In this talk I present a compiler-based technique for adding explicit memory management to Java. The key feature of our approach is that it is automatic: the just-in-time compiler analyzes programs to identify dead objects and inserts calls to "free" without user intervention. Since the lifetime of objects cannot always be determined statically, the technique operates as a complementary component to the garbage collector. Results show that 40% to 60% of all objects can be explicitly freed, allowing some programs to run as much as 3X faster under memory-constrained conditions.