【问题标题】:Where to set <gcAllowVeryLargeObjects>?在哪里设置 <gcAllowVeryLargeObjects>?
【发布时间】:2016-12-25 20:11:11
【问题描述】:

我正在开发一个关于排序列表的小程序。现在,我需要一个需要 2GB 以上 RAM 的阵列。在研究过程中,我找到了该属性,但我不知道在哪里设置它。我正在使用单声道。

【问题讨论】:

  • PS:我的意思是属性

标签: c# arrays mono


【解决方案1】:

如果你正在使用 appsettings.json,你可以这样使用它:

    "runtimeOptions": {
    "gcAllowVeryLargeObjects": {
      "enabled": true
      }
    }

【讨论】:

    【解决方案2】:

    对于非常大的 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-02
      • 2020-03-07
      • 1970-01-01
      • 2019-01-05
      • 1970-01-01
      • 1970-01-01
      • 2011-09-05
      • 2012-06-15
      相关资源
      最近更新 更多