问题描述
如何在Mac OSX中设置此环境变量的值?我尝试在Xamarin.Android项目中使用AndroidEnvironment的构建操作创建一个environment.txt文件,但是当我检查诊断构建输出时,仍然看到以下内容:
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 AndroidEnvironment, but when I check my diagnostic build output, I still see this:
MONO_GC_PARAMS = major=marksweep-conc
我没有设置该值-它必须是默认值,但是我找不到它的存储位置或更改方式.谢谢.
I didn't set that value - it must be the default, but I can't find where it's stored or how to change it. Thank you.
推荐答案
这些项目必须放在一行中,并用逗号分隔参数.即MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=128m,soft-heap-limit=512m,major=marksweep-conc
These items need to be on a single line with commas seperating the parameters. i.e. MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=128m,soft-heap-limit=512m,major=marksweep-conc
这将通过以下代码:
if (lineToWrite.StartsWith ("MONO_GC_PARAMS=", StringComparison.Ordinal))
haveMonoGCParams = true;
如果在项目设置中启用了Use the concurrent garbage collector (Experimental)
,则应该能够设置此项目.此定义将添加到您的.csproj
:
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>
这会将以下参数设置为Mono:
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");
}
但是,我相信通过此逻辑只有两个选项可用. marksweep
或marksweep-conc
.
However I believe only two options are available via this logic. Either marksweep
or marksweep-conc
.
这篇关于Xamarin.Android-如何设置MONO_GC_PARAMS环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!