added ability to take heap snapshots