Large array support in ASP.NET
Asked Answered
C

2

3

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.

Conceivable answered 29/10, 2012 at 22:37 Comment(4)
Have you considered using IIS Express instead of Casini (VS's internal server)?Constituency
Im trying to deploy the website on an IIS7 server on Windows7 x64 bit machine.Conceivable
I meant IIS Express for your development environment.Constituency
In VS2012, if I make my target platform for the web app as x64, the webpage just crashes with this error "Could not load file or assembly 'WebApplication1' or one of its dependencies. An attempt was made to load a program with an incorrect format."Conceivable
F
0

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

Flocculent answered 29/10, 2012 at 22:44 Comment(5)
I tried that but allocating more than 1 gig ends up with out of mem exception. Is there anything else than gcAllow.. and making app pool to 64bit?Conceivable
@Conceivable Is your pool 64bit running ? and your site the same ?Flocculent
Yes it is.. Programmatically, on the code behind I can see that IntPtr.Size is 8.Conceivable
@Conceivable You can also see it with process explorer, its show if its run on 64bit or not. If you can run the process explorer from sysinternals to see how memory is use. Also check if you have place an y memory limits on the pool that make it restart.Flocculent
I just want to know if large arrays (>2gb) is supported in ASP.NET or not.Conceivable
A
0

For me setting gcAllowVeryLargeObjects in the application web.config only worked when put in machine.config

Alkalify answered 10/3, 2014 at 17:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.