Search code examples
maui

How do I specify nursery-size for Android in .NET MAUI app?


I am new to .NET MAUI and Xamarin.

I'm building an Android app using .NET MAUI.
I learned that in Xamarin, I can add nursery-size like MONO_GC_PARAMS=nursery-size=128m to a file (.conf file?).
Can I do something like it in MAUI app? If it's possible, how do I do it?


Solution

  • You should be able to do it by adding a file by the name of env.conf make sure the build action is set to Android Environment

    In that file then you can add the config, something like this:

    MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=128m,soft-heap-limit=512m 
    

    NOTE: I have added multiple options above; only add the ones you need.

    Options:

    enter image description here

    The one you need to select:

    enter image description here