Debugging Dynamic Memory Usage Errors Using NonStop Native Inspect White Paper
NOTE: Native Inspect supports the debugging of physical memory leaks only. It does not detect
logical memory leaks.
Access Errors
Memory access errors can occur under the following conditions:
• When reading uninitialized local or heap data.
• When reading or writing to nonexistent, unallocated, or unmapped memory.
• When a stray pointer overflows the bounds of a heap block, or tries to access a heap block
that is already freed to cause buffer overruns and under-runs.
• When reading or writing to memory locations that are already freed in the program.
NOTE: Currently, Native Inspect does not provide support for debugging memory access errors.
Using Native Inspect to Debug Memory Problems
Native Inspect supports the memory-debugging of applications involving dynamic allocations and
de-allocations of virtual memory blocks, or during the calls to zcredll string routines like
strcpy(),and memcpy(). It debugs memory-related problems at the time of allocation or
de-allocation of memory blocks. It supports the detection of outstanding memory-related problems
at specific user-defined probe-points (breakpoints) while heap memory is being used.
NOTE: The term probe-point is used subsequently to refer to a program execution path location
at which the program is suspended for the purpose of making a heap check.
Memory-related problems that appear after the specified probe points are not detected. Native
Inspect does not support the debugging of access errors that are caused when reading from or
writing to unallocated, uninitialized, or de-allocated memory. Native Inspect does not support the
memory-debugging of the stack, static memory, and register memory.
Native Inspect provides the interactive and attach modes for debugging memory-related problems.
See “Supported Modes of Memory-debugging in Native Inspect” (page 10) for more information
on the supported modes for debugging.
Memory-Debugging Features of Native Inspect
Native Inspect supports the following memory-debugging features:
• Heap Profiling features
• Leak Profiling feature
• Event Monitoring features
In addition to these features, Native Inspect provides the following generic commands for memory
debugging:
Table 1 Generic Commands for Memory Checking
Command DescriptionArgumentsCommand
Enables and disables memory checking.
This includes the setting of commands
<on/off>set heap-check
for detecting leaks, bounds, double
frees, and heap profiling.
Displays the current settings for memory
checking.
show heap-check
8










