Debugging Memory Problems with MemoryScape : Chapter 1 Locating Memory Problems : Batch Scripting and Using the CLI : Using the -dheap Command : Filtering Heap Information: dheap -filter
Filtering Heap Information: dheap -filter
Depending upon the way in which your program manages memory, MemoryScape might be managing a lot of information. You can filter this information down to focus on things that are important to you at the moment by using filters. These filters can only be created using the GUI. However, after you create a filter using the GUI, you can apply it from within the CLI by using the dheap -filter commands.
Here is an excerpt from a CLI interaction:
d1.<> dheap -filter -list
Filtering of heap reports is 'disabled'
Individual filters are set as follows:
Disabled MyFilter Function contains strdup
d1.<> dheap -filter -enable MyFilter
d1.<> dheap -filter -enable
d1.<> dheap -filter -list
Filtering of heap reports is 'enabled'
Individual filters are set as follows:
Enabled MyFilter Function contains strdup
d1.<>
Notice that TotalView automatically knew about your filters. That is, it always reads your filter file. However, TotalView ignores the file until you both enable the file and enable filtering. That is, while the following two commands look about the same, they are different:
dheap -filter -enable MyFilter
dheap -filter -enable
The first command tells MemoryScape that it could use the information contained within the MyFilter filter. However, MemoryScape only uses it after you enter the second command.