问题
Recently with 4.5 .NET support, users can allocate more than 2 GB of memory for an object. In order to do that users can set the gcAllowVeryLargeObjects to true in the app.config file, and things would work fine.
However I am having difficulty in finding this setting for ASP.NET. I have an web site for which I need to test if this is really supported in our web site. I know that the VS inbuilt server is a 32 bit process. So it users can't simply launch the website and test it for large arrays.
Is this even possible with ASP.NET? I am using IIS7 to host my website.
回答1:
Acording to MSDN you can setup it at web.config as:
<configuration>
<runtime>
<gcAllowVeryLargeObjects enabled="true" />
</runtime>
</configuration>
but its says:
true: Arrays greater than 2 GB in total size are enabled on 64-bit platforms.
so its not work on 32bit, meaning that you also need to run your pool on 64-bit.
ref: http://msdn.microsoft.com/en-us/library/hh285054.aspx
回答2:
For me setting gcAllowVeryLargeObjects
in the application web.config
only worked when put in machine.config
来源:https://stackoverflow.com/questions/13130676/large-array-support-in-asp-net