Memory Block Notification
When a specific block of memory has been freed but your program tries to access that memory later through a dangling pointer reference, the result can be invalid data that causes sporadic crashes or data problems whose cause can be hard to pinpoint. To help identify these kinds of memory problems, you can set TotalView to watch a specific allocated memory block and then raise an event when the memory is freed or deleted.
To tag a specific memory block, run to a location in your code and examine a pointer variable in either the Local Variable view or Data View. Dereference the pointer, then right click on it, and select Notify on Free or Realloc from the context menu.
Figure 182, Memory blocks, “Notify on Free or Realloc”
A checkbox displays next to the context menu entry, and the variable’s entry in the Data View or Local Variables view reports that notifications are turned on for this variable:
When a tagged block of memory is freed or reallocated, the Event Report opens, displaying the exact location where the memory was both initially allocated and freed.
Figure 183, Memory blocks, Event Report