Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的单声道服务中检测运行时正在运行的垃圾收集器。这可能吗?
对的,这是可能的:
public static bool IsRunningWithSGen () { return System.GC.MaxGeneration > 0; }
和 Boehm 的替代方案:
public static bool IsRunningWithBoehm () { return System.GC.MaxGeneration == 0; }