Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Memory Leak Detection

IP.com Disclosure Number: IPCOM000109956D
Original Publication Date: 1992-Oct-01
Included in the Prior Art Database: 2005-Mar-25
Document File: 2 page(s) / 55K

Publishing Venue

IBM

Related People

Albaugh, VA: AUTHOR [+2]

Abstract

A recurring problem in UNIX* systems is the detection of "memory leaks". A memory leak is the incorrect use of memory allocate and deallocate routines, such that an ever increasing amount of virtual memory is allocated and not freed. This problem eventually results in system failure due to running out of virtual memory or paging space. Recognition and isolation of the problem can be difficult.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 56% of the total text.

Memory Leak Detection

       A recurring problem in UNIX* systems is the detection of
"memory leaks".  A memory leak is the incorrect use of memory
allocate and deallocate routines, such that an ever increasing amount
of virtual memory is allocated and not freed.  This problem
eventually results in system failure due to running out of virtual
memory or paging space.  Recognition and isolation of the problem can
be difficult.

      A method for memory leak detection and isolation is built on
the AIX** trace facility(1) and a variation of the tprof(2) address
correlation technology.  The approach can be used to detect leaks in
system services as well as user level code.

      An alternate version of the c library is built to insert trace
hooks into the malloc and free subroutines. The hooks provide the
following information:
      Malloc hook:
         1) CA -> Address of the caller of the malloc service.
         2) MA -> Address of the new memory allocated by the call
      Free hook:
         1) MA -> The starting address of the memory deallocated by
the call.

      In the normal case, the malloc and free calls should be paired.
That is, for each malloc there should be a corresponding free.  With
trace activated, a real time program called "leakdetect" gathers the
malloc and free hooks along with other system hooks that allow
resolution of 1) process name and 2) process id.  The "leakdetect"
program creates a hash...