Debugging Memory Problems with MemoryScape™ : Chapter 1 Locating Memory Problems : Batch Scripting and Using the CLI : Using the dheap Command
Using the dheap Command
 
NOTE >> You must be using MemoryScape with TotalView to have access to the CLI.
 
NOTE >> For a complete description of the dheap command, see the dheap command description in the Reference Guide.
The dheap command tracks memory problems from within the CLI. It supports the same functionality as the GUI, with some additional options. Here are actions available through the dheap command:
To see the status of MemoryScape, use the dheap command with no arguments, or with the -status argument.
To enable and disable MemoryScape, use dheap -enable and dheap -disable.
To display information about the heap, use dheap -info. You can show information for the entire heap or limit what TotalView displays to just a part of it.
To limit backtrace information to only the information that is important to you, use the dheap -backtrace command.
To report errors when data is written outside a memory allocation, use the dheap -guard command.
To determine whether there are pointers that point to or within a deallocated memory block, use the dheap -is_dangling command.
To be notified of memory allocation or reallocation, use the dheap ‑tag_alloc command.
To start and stop error notification, use dheap -notify and dheap -nonotify.
To filter the information displayed, use dheap -filter.
To check for leaks, use dheap -leaks.
To paint memory with a bit pattern, use dheap -paint.
To hoard memory, use dheap -hoard.
To export view information, use dheap -export.
To detect bounds and use-after-free errors, use dheap ‑red_zones.
To compare memory states, either against a baseline or against a saved state or between two saved states, use dheap -compare.
 
NOTE >> Some dheap options are not available in the GUI.