The Xamarin Cross-Platform Performance Documentation states:
When SGen starts a garbage collection, it will stop the application's threads while it reclaims memory.
I'm wondering about a few details:
The standard caveat applies that you should profile to see how this plays out in your case, but here are some answers:
And lastly, yes, this has recently changed significantly with the addition of concurrent garbage collection :
Traditionally, when Mono's memory manager determined that it should perform a garbage collection, the collector had to pause all Mono running threads, perform the garbage collection, and once it was done, it resumed the execution of those threads.
With concurrent garbage collection, we are able to perform collections on the old generation (what we call major collections) mostly concurrently with your application - it happens at the same time as your program is running. When the major collection is completed, the collector only needs to pause the Mono threads for a very brief period of time at the end.
Concurrent GC is available as a build option in the current stable version of Xamarin (see link for details).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.