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 2% 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]  Kathryn S. McKinley,et al.  Reconsidering custom memory allocation , 2002, OOPSLA '02.

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

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

[4]  Marvin Theimer,et al.  Preemptable remote execution facilities for the V-system , 1985, SOSP '85.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[23]  E. Berger,et al.  Plug : Automatically Tolerating Memory Leaks in C and C + + Applications Gene , 2008 .

[24]  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.

[25]  Hans-Juergen Boehm Space efficient conservative garbage collection , 2004, SIGP.

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

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

[28]  Robert O. Hastings,et al.  Fast detection of memory leaks and access errors , 1991 .

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

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

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

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

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