Xamarin.Android-如何设置MONO_GC_PARAMS环境变量 [英] Xamarin.Android - How do you set the MONO_GC_PARAMS environment variable

查看:174
本文介绍了Xamarin.Android-如何设置MONO_GC_PARAMS环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在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=128‌​m,soft-heap-limit=51‌​2m,major=marksweep-c‌​onc

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

这将通过以下如果在项目设置中启用了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");
            }

来源

但是,我相信通过此逻辑只有两个选项可用. marksweepmarksweep-conc.

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

这篇关于Xamarin.Android-如何设置MONO_GC_PARAMS环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆