News:

Build a stunning handcrafted website with IT Acumens

Main Menu

What is Memory Interceptor Library?

Started by Kalyan, Jul 23, 2008, 09:06 PM

Previous topic - Next topic

Kalyan

What is Memory Interceptor Library?

Memory Interceptor Library is a shared library that intercepts standard memory calls: malloc, calloc, realloc, free, etc., from binary applications and analyzes a program for memory leaks. The library can be used with any preexisting program that was written in C and was linked as a shared executable. No relinking of applications is required. Memory trace data is sent to a remote application where it is analyzed for memory leaks.

This memory leak detector tries to locate memory leaks that can occur in a production environment. The goals are to minimize the overhead, minimize the amount of data needed to be saved, and make the program usable on native binary applications where source code is not available and no additional re-linking of programs is required.

This package includes a dynamic library, a memory agent, and a memory leak detector. The dynamic library intercepts native memory calls and logs the information to another process, which is typically located on another machine located on the same LAN. The data is either stored for later analysis or analyzed in real time.

How does it work?

The memory interceptor works by intercepting calls to the standard C memory functions. A script is run that allows the memory interceptor library to be loaded before an application is loaded. The memory calls will be referenced by the new library and will subsequently call the original functions (in libc). The data is streamed over a network connection to a remote application where it can be analyzed for memory leaks.

For all memory allocations that an application makes, a stack trace is kept for the callback functions that led to this allocation. The stack trace is used to help find the location of the memory leak.

The memory analyzer can be configured to display the top (or all) memory leaks based on frequency of occurrence or number of bytes leaked. The memory analyzer uses a non-relational database to maintain the current memory allocations. Because the actual data received from the memory interceptor library need not be kept on the production machine, the amount of required storage is reduced.