Table of Contents

Generating a Heap Report

Memory

The SpeedTree SDK has a mechanism for generating a file-based report that describes every heap allocation made by the SDK and anything else that uses the memory management functions in Core/Memory.h. This includes virtually everything in the reference applications, save heap allocations made by other libraries used there (DXUT, glut, glew, etc.) and the graphics API themselves. All of the SpeedTree-related classes in the reference application are set up to use the SDK memory interface.

This section of the document details how to generate a report of every heap allocation routed through this interface. This report is also a good way to track memory leaks for anything that's using the allocation interface. Imbalanced new/delete calls will be revealed in the report.


Generating a Report

You must be able to recompile the SpeedTree SDK in order to generate a report, which will require a source code license. Enable heap allocation tracking by #defining SPEEDTREE_MEMORY_STATS at the top of Allocator.h in the Core library (it is there by default, commented out).

Note: Please be sure to comment SPEEDTREE_MEMORY_STATS out when performance is a concern as it does add some overhead to the SDK's execution.

The next step will be to make a single call from within the client engine or application:






Notes