Normally when working in C#, if I want to force a garbage collection, including the large object heap, I would do the following (possibly with extra args on the GC.Collect call):
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; GC.Collect(); GC.WaitForPendingFinalizers();
Building for mobile using Xamarin.Forms, I don't see the LargeObjectHeapCompactionMode property on GCSettings. Is there an alternative way of forcing everything that is unreferenced to be garbage collected when using XF?
I want to include some code during development that at the press of a button will check that all of my page objects (other than the current page) are no longer referenced. The base class that I use for all page objects keeps track of whether a particular page type has been instantiated but not yet finalized. However, I need to be able to force the finalize of all unreferenced objects when I press the button.