Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to set <gcAllowVeryLargeObjects>?

Tags:

arrays

c#

mono

I'm working on a little program on sorting lists. Now, I need an array that requires more than 2GB of RAM. During my research, I found the property, but I don't know where so set it. I'm using Mono.

like image 303
Domi Avatar asked Aug 18 '16 19:08

Domi


2 Answers

For very large ArrayList objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the enabled attribute of the gcAllowVeryLargeObjects configuration element to true in the run-time environment.

MyCustomApp.config

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

Usage:

mono64 --config MyCustomApp.config Foobar.exe
like image 147
SushiHangover Avatar answered Oct 16 '22 06:10

SushiHangover


If you are using appsettings.json you can use it like this:

    "runtimeOptions": {
    "gcAllowVeryLargeObjects": {
      "enabled": true
      }
    }
like image 1
Chanev Avatar answered Oct 16 '22 07:10

Chanev