in JetBrains.Profiler.SelfApi/src/DotMemory.cs [234:249]
public static string GetSnapshotOnce(Config config)
{
if (config == null) throw new ArgumentNullException(nameof(config));
lock (Mutex)
{
ConsoleRunnerPackage.VerifyReady();
if (_session != null)
throw new InvalidOperationException("The profiling session is active already: Attach() was called early.");
Attach(config);
GetSnapshot();
return Detach();
}
}