在哪里设置<gcallowverylargeobjects>?

时间:2016-08-18 19:17:16

标签: c# arrays mono

我正在研究一个关于排序列表的小程序。现在,我需要一个需要超过2GB RAM的阵列。在我的研究期间,我找到了这个属性,但我不知道在哪里设置它。我正在使用Mono。

1 个答案:

答案 0 :(得分:8)

  

对于非常大的ArrayList对象,通过在运行时环境中将gcAllowVeryLargeObjects配置元素的enabled属性设置为true,可以将64位系统上的最大容量增加到20亿个元素。

MyCustomApp.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <gcAllowVeryLargeObjects enabled="true" />
  </runtime>
</configuration>

用法:

mono64 --config MyCustomApp.config Foobar.exe