Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ public static void Test(int countMaxWorkerThreads, int countMaxCompletionThreads

ThreadPool.SetMaxThreads(countMaxWorkerThreads, countMaxCompletionThreads);

// Induce Gen0-only collections BEFORE the agent starts. GCSamplerV2 reads
// cumulative GC.CollectionCount() values, so these pre-agent collections
// guarantee that CollectionCount(0) > CollectionCount(1) by the time the
// first sample runs — regardless of when the sampler fires relative to
// StartAgent(). V1 (EventListener-based) is unaffected since it only
// captures events after the listener registers inside StartAgent().
GC.Collect(0);
GC.Collect(0);

StartAgent();
}

Expand Down
Loading