Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

GC.Collect() in my Xamarin Forms project

$
0
0

Hello,
I have a problem trying to implement GC.Collect() in my Xamarin Forms project

What i exactly did is:
1-Create a new file in my android project: android-environment.sh
2-Add MONO_GC_PARAMS=soft-heap-limit=128m,bridge-implementation=tarjan inside
3-Set the build Action of this file: Android environment

In my class in my Xamarin Form project,
protected override void OnDisappearing ()
{

            this.BindingContext = null;
            ImagesList = null;
            this.Content = null;
            base.OnDisappearing ();
            GC.Collect ();

}

I tested it using Xamarin Profiler and i cant see any change, just my memory allocated increase


Viewing all articles
Browse latest Browse all 91519

Trending Articles