Opening a big memory snapshot sometimes takes a lot of time.
When a snapshot is loaded for the first time the profiler can store some pre-calculated information, the snapshot index, to a file alongside the original snapshot. The snapshot index will make the next snapshot opening much faster.
The snapshot index files may be helpful in analyzing big snapshots on a 32-bit workstation. The index files can be generated on a 64-bit machine, via the profiler UI or a command line tool (see below), and then transferred back to your workstation, in order to accelerate the memory snapshot opening in future.
Saving the index from the profiler UI
When you close a memory snapshot opened in the profiler UI or exit the profiler UI with memory snapshots open, the index files will be created automatically if they do not exist.
You can turn the automatic saving of index files off with the help of Settings | Save Snapshot Index on Close
Also, you can manually save current snapshot's index with the help of File | Save Snapshot Index.
This can be useful if you have disabled the autosave.
Saving the index with command line tool
You can create snapshot index file using the following command:
On 64-bit machine:
<Profiler Installation Directory>\jre64\bin\java -jar <Profiler Installation Directory>\lib\yjp.jar -create-index <snapshot_file_path>
On 32-bit machine:
<Profiler Installation Directory>\jre\bin\java -jar <Profiler Installation Directory>\lib\yjp.jar -create-index <snapshot_file_path>
The index file location
When the profiler loads a memory snapshot, it looks for the index file in
the same directory as the snapshot file.
The index file name is formed from the snapshot file name with .index postfix added.
If there is no index file found, the snapshot will be opened from scratch.
For example:
Snapshot named foo.snapshot will have index file name foo.snapshot.index
When saving snapshot index, make sure the directory where snapshot is located is writable and there is enough disk space (the index size can be comparable with the size of the snapshot.)
