Large array support in ASP.NET

折月煮酒 提交于 2019-12-06 07:08:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!