/// <summary> /// Builds a cache of the GC heap and roots. This will consume a LOT of memory, so when calling it you must wrap this in /// a try/catch for OutOfMemoryException. /// /// Note that this function allows you to choose whether we have exact thread callstacks or not. Exact thread callstacks /// will essentially force ClrMD to walk the stack as a real GC would, but this can take 10s of minutes when the thread count gets /// into the 1000s. /// </summary> /// <param name="cancelToken">The cancellation token used to cancel the operation if it's taking too long.</param> public void BuildCache(CancellationToken cancelToken) { _heap.CacheRoots(cancelToken); _heap.CacheHeap(cancelToken); }