## Taking a Snapshot

See Also

You can use a
to capture profiling data at a specific point in time. The data captured in a snapshot depends on the type of profiling session in progress when the snapshot is taken.

A snapshot differs from live profiling results in the following ways:

- Snapshots can be examined when no profiling session is running.
- Snapshots contain a more detailed record of profiling data than live results.
- Snapshots can be easily compared (memory snapshots).

### Taking Snapshots

You can only take a snapshot while a profiling session is in progress. You can take a snapshot manually or set a profiling point to take a snapshot automatically at a precise point in your application. When you use a profiling point to take a snapshot, you locate the point in your source code where you want to take a snapshot. For example, you may want to take a snapshot when a thread enters a specific method.

To take a snapshot manually

1. Start a profiling session
2. Do one of the following:
   - Click Take Snapshot in the Profiler window.
   - Click Live Results to open Live Profiling Results and then click Take Snapshot of Collected Results in the toolbar.

When you take a snapshot, the snapshot opens in the main editor window. You can then save the snapshot to your project.

To take a snapshot using a profiling point

1. Open the source file containing the method where you want to place the profiling point.
2. Right-click in the line of code containing the method and choose Insert Profiling Point.
3. Select Snapshot in the Profiling Point wizard and click Next.
4. Modify any of the profiling point properties and click Finish.

When you run the profiling session, the IDE takes a snapshot every time a thread enters the line of code containing the profiling point.

### Saving Snapshots

You can save a snapshot to your project or you can save the snapshot to a location on your local file system. When you save a snapshot to your project, the snapshot is listed under Saved Snapshots in the Profiler window. You can save a snapshot by clicking the Save to Project button in the snapshot toolbar. Alternatively, you can use the Options window to configure the IDE behaviour when taking a snapshot.

See Also
  Selecting a Profiling Task
  Setting Profiling Points
  Exploring Snapshots
  Working with Live Profiling Results

Legal Notices