Xamarin.Android - How do you set the MONO_GC_PARAMS environment variable

后端 未结 1 1091
野趣味
野趣味 2021-01-24 22:12

How do you set the value of this environment variable in Mac OSX? I tried creating an environment.txt file in my Xamarin.Android project with a build action of AndroidEnvironmen

相关标签:
1条回答
  • 2021-01-24 22:27

    These items need to be on a single line with commas seperating the parameters. i.e. MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=128‌​m,soft-heap-limit=51‌​2m,major=marksweep-c‌​onc

    This will be picked up via the following code:

    if (lineToWrite.StartsWith ("MONO_GC_PARAMS=", StringComparison.Ordinal))
                            haveMonoGCParams = true;
    

    You should be able to set this item if you have the Use the concurrent garbage collector (Experimental) enabled in your project settings. This definition will be added to your .csproj:

    <AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
    

    This will set the following parameter to Mono:

    if (!haveMonoGCParams) {
                    if (EnableSGenConcurrent)
                        environment.WriteLine ("MONO_GC_PARAMS=major=marksweep-conc");
                    else
                        environment.WriteLine ("MONO_GC_PARAMS=major=marksweep");
                }
    

    Source

    However I believe only two options are available via this logic. Either marksweep or marksweep-conc.

    0 讨论(0)
提交回复
热议问题