Is it possible to determine the current implementation of the garbage collector using mono?

We have an assembly provided to us by a third party that leaks memory when using the GC GC BGM for mono, but it is not a leak when using the GC S-Gen.

When we run the program, we want to warn the user if he is using the "wrong" GC, and for this we need to determine which one is used.

Is there an API to detect this?

+4
source share
1 answer

There is no defined API, but you can use GC.MaxGeneratio: when using GC Boehm it will be 0 or higher with sgen GC.

+3
source

Source: https://habr.com/ru/post/1381487/


All Articles