Taking a Heap Dump

See Also

You can take a when a profiling session is in progress. When you take a heap dump you are prompted to save the heap to your project or local file system. After you save a heap dump, you can load the heap dump at any time and browse the objects on the heap and locate references to individual objects. You do not need to have a running profiling session to load and browse the heap dump.

Taking Heap Dumps

If a profiling session is in progress you can take and save a heap dump. You can take a heap dump manually or set a profiling point to take a heap dump automatically at a certain point in your application. In the Options window, you can also set the IDE to automatically take a heap dump on OutOfMemory error.

To take a heap dump manually:

  1. Start a profiling session.
  2. Choose Profile > Take Heap Dump in the main menu.

When you take the heap dump, you are prompted to specify where you want to save the heap dump. You can save the heap dump snapshot to your project or to any location on your local filesystem.

To take a heap dump using a profiling point:

  1. Open the source file containing the code where you want to place the profiling point.
  2. Right-click in the line of code where you want to place the profiling point and choose Profile > Insert Profiling Point.
  3. In the New Profiling Point wizard, select one of the following snapshot options and click Next.
  4. In the Customize Properties page of the wizard, select Heap Dump as the type of snapshot and modify any additional settings. Click Finish.

When you use a profiling point to take a heap dump, you specify the point in your source code where you want to place the profiling point. For example, you may want to take a heap dump when a thread enters a specific method.

To take a heap dump on OutOfMemory error:

  1. Choose Tools > Options from the main menu, click the Miscellaneous category and then click the Profiler tab.
  2. For the On OutOfMemory Error setting, choose an option from the drop-down list and specify a location for the saved heap dump (optional).

Loading a Heap Dump

You can load and browse a heap dump at any time. You do not need to be running a profiling session to load a heap dump.

  1. Choose Profile > Load Heap Dump in the main menu.
  2. Locate the heap dump on your system and click Open.

When you load a heap dump, the heap dump opens in the Heap window.

See Also
Browsing a Heap Dump
Setting Profiling Points
Working with Live Profiling Results

Legal Notices