KAL: kernel-assisted non-invasive memory leak tolerance with a general-purpose memory allocator

Memory leaks are a continuing problem in the software developed with programming languages, such as C and C++. A recent approach adopted by some researchers is to tolerate leaks in the software application and to reclaim the leaked memory by use of specially constructed memory allocation routines. However, such routines replace the usual general-purpose memory allocator and tend to be less efficient in speed and in memory utilization. We propose a new scheme which coexists with the existing memory allocation routines and which reclaims memory leaks. Our scheme identifies and reclaims leaked memory at the kernel level. There are some major advantages to our approach: (1) the application software does not need to be modified; (2) the application does not need to be suspended while leaked memory is reclaimed; (3) a remote host can be used to identify the leaked memory, thus minimizing impact on the application program's performance; and (4) our scheme does not degrade the service availability of the application while detecting and reclaiming memory leaks. We have implemented a prototype that works with the GNU C library and with the Linux kernel. Our prototype has been tested and evaluated with various real-world applications. Our results show that the computational overhead of our approach is around 2p of that incurred by the conventional memory allocator in terms of throughput and average response time. We also verified that the prototype successfully suppressed address space expansion caused by memory leaks when the applications are run on synthetic workloads. Copyright © 2010 John Wiley & Sons, Ltd.

[1]  Ben Zorn,et al.  A memory allocation profiler for c and lisp , 1988 .

[2]  Jeff Bonwick,et al.  The Slab Allocator: An Object-Caching Kernel Memory Allocator , 1994, USENIX Summer.

[3]  John McCarthy,et al.  Recursive functions of symbolic expressions and their computation by machine, Part I , 1960, Commun. ACM.

[4]  Andrew Warfield,et al.  Live migration of virtual machines , 2005, NSDI.

[5]  Emery D. Berger,et al.  Garbage collection without paging , 2005, PLDI '05.

[6]  Keith A. Lantz,et al.  Preemptable remote execution facilities for the V-system , 1985, SOSP 1985.

[7]  Kathryn S. McKinley,et al.  Reconsidering custom memory allocation , 2002, OOPSLA '02.

[8]  Nicholas Nethercote,et al.  Using Valgrind to Detect Undefined Value Errors with Bit-Precision , 2005, USENIX Annual Technical Conference, General Track.

[9]  R. Krishnakumar Kernel korner: kprobes-a kernel debugger , 2005 .

[10]  Michael D. Bond,et al.  Tolerating memory leaks , 2008, OOPSLA.

[11]  Benjamin G. Zorn,et al.  Using lifetime predictors to improve memory allocation performance , 1993, PLDI '93.

[12]  Onn Shehory,et al.  Can self-healing software cope with loitering? , 2007, SOQUA '07.

[13]  Hans-Juergen Boehm Bounding space usage of conservative garbage collectors , 2002, POPL '02.

[14]  Matthias Hauswirth,et al.  Low-overhead memory leak detection using adaptive statistical profiling , 2004, ASPLOS XI.

[15]  Emery D. Berger,et al.  DieHard: probabilistic memory safety for unsafe languages , 2006, PLDI '06.

[16]  Scott Shenker,et al.  Mostly parallel garbage collection , 1991, PLDI '91.

[17]  Leslie Lamport,et al.  On-the-fly garbage collection: an exercise in cooperation , 1975, CACM.

[18]  Tal Garfinkel,et al.  VMwareDecoupling Dynamic Program Analysis from Execution in Virtual Environments , 2008, USENIX Annual Technical Conference.

[19]  Carl A. Waldspurger,et al.  Memory resource management in VMware ESX server , 2002, OSDI '02.

[20]  Hans-Juergen Boehm,et al.  Garbage collection in an uncooperative environment , 1988, Softw. Pract. Exp..

[21]  Toshio Endo,et al.  Reducing pause time of conservative collectors , 2002, ISMM '02.

[22]  Martin C. Rinard,et al.  Detecting and eliminating memory leaks using cyclic memory allocation , 2007, ISMM '07.

[23]  Yuanyuan Zhou,et al.  SafeMem: exploiting ECC-memory for detecting memory leaks and memory corruption during production runs , 2005, 11th International Symposium on High-Performance Computer Architecture.

[24]  Emery D. Berger,et al.  Archipelago: trading address space for reliability and security , 2008, ASPLOS.

[25]  Kathryn S. McKinley,et al.  Composing high-performance memory allocators , 2001, PLDI '01.

[26]  David Mosberger,et al.  httperf—a tool for measuring web server performance , 1998, PERV.

[27]  Wolfgang Küchlin,et al.  PARSAC-2: A Parallel SAC-2 Based on Threads , 1990, AAECC.

[28]  Michael D. Bond,et al.  Leak pruning , 2009, ASPLOS.

[29]  Qi Gao,et al.  LeakSurvivor: Towards Safely Tolerating Memory Leaks for Garbage-Collected Languages , 2008, USENIX Annual Technical Conference.