using System.Runtime.CompilerServices; CreateUnrooted(); GC.Collect(2, GCCollectionMode.Forced, blocking: true); GC.WaitForPendingFinalizers(); Console.WriteLine($"finalizers:{Probe.Count}"); GC.Collect(2, GCCollectionMode.Forced, blocking: true); Console.WriteLine("second-collection-requested;RSS-not-asserted"); [MethodImpl(MethodImplOptions.NoInlining)] static void CreateUnrooted() { _ = new Probe(); } sealed class Probe { public static int Count; private readonly byte[] payload = new byte[100_000]; ~Probe() { Interlocked.Increment(ref Count); GC.KeepAlive(payload); } }