Debugging methods for heap misuse
AssigneeInternational Business Machines Corporation
InventorsCary Lee Bates, Paul Reuben Day, John Matthew Santosuosso
Life of this patent
Estimating the term…
Abstract
The present invention generally provides a method, apparatus and article of manufacture for debugging computer programs. Debugging computer programs is aided by monitoring allocations and deallocations of memory space. The resulting information can be processed to return meaningful data to a user including, for example, a hexadecimal view of memory distinguishing allocated memory from free memory, the allocation/deallocation history of a memory space, a relationship between an allocator and a deallocator, whether a user-established relationship between an allocator and a deallocator was violated, whether a user-established memory limit was exceeded, and the like.
Claims22
A method for managing memory available for dynamic allocation during execution of code containing a plurality of memory allocators and a plurality of memory deallocators, comprising:
- allowing a user to establish a relationship between one or more of the memory deallocators and one or more of the memory allocators, wherein the relationship requires that memory space allocated by the one or more allocators is freed by the one or more deallocators;
- allowing the code to execute;
- upon a call to the one or more deallocators to free a memory space, determining whether the relationship is violated;
- and
- if so, notifying the user.
A method for managing memory available for dynamic allocation during execution of code containing a plurality of memory allocators and a plurality of memory deallocators, comprising:
- establishing a relationship between a user-selected memory deallocator and a user-selected memory allocator, wherein the relationship requires that memory space freed by the user-selected deallocator have been allocated by the user-selected allocator;
- allowing the code to execute;
- upon a call to the user-selected deallocator to free a memory space, determining whether the memory space was allocated by the user-selected allocator;
- and
- if so, notifying the user that the relationship is violated.
A method for managing memory available for dynamic allocation during execution of code containing a plurality of memory allocators and a plurality of memory deallocators, comprising:
- setting an upper limit on the amount of memory space an allocator can allocate during execution of the code, wherein the upper limit is specific to the allocator;
- during execution of the code, tracking the amount of memory space allocated by the allocator;
- and
- when the amount of memory space allocated exceeds the limit, notifying a user.
A computer readable medium containing a program which, when executed, performs an operation for managing memory available for dynamic allocation during execution of code containing a plurality of memory allocators and a plurality of memory deallocators, the operation comprising:
- establishing a relationship between a user-selected memory deallocator and a user-selected memory allocator, wherein the relationship requires that memory space freed by the user-selected deallocator have been allocated by the user-selected allocator;
- allowing the code to execute;
- upon a call to the user-selected deallocator to free a memory space, determining whether the memory space was allocated by the user-selected allocator;
- and
- if so, notifying the user that the relationship is violated.
A computer readable medium containing a program which, when executed, performs an operation for managing memory available for dynamic allocation during execution of code containing a plurality of memory allocators and a plurality of memory deallocators, the operation comprising:
- setting an upper limit on the amount of memory space an allocator can allocate during execution of the code, wherein the upper limit is specific to the allocator;
- during execution of the code, tracking the amount of memory space allocated by the allocator;
- and
- when the amount of memory space allocated exceeds the limit, notifying a user.
A computer system comprising an output device, a memory device, one or more processors, code resident in the memory device and containing a plurality of memory allocator calls and a plurality of memory deallocator calls, a heap manager resident in the memory device to allocate and free memory of the memory device and a debugger program resident in the memory device;
- the debugger program comprising a debugger user interface configured to at least:
- allow a user to view allocation/deallocation history information at a user-specified memory location;
- and
- allow a user to establish a relationship between a memory deallocator call and a memory allocator call, wherein the relationship requires that memory space allocated by the memory allocator call is freed by the memory deallocator call and a violation of the requirement causes the debugger user interface to notify the user.
Dependencies are inferred from the claim text.