Reputation: 6921
I have an asp.net application with other 6 class library projects. In one of my class library project which main one, I cache some static DB tables. Webdev.webserver40.exe reaches about 1,5 gb and It throws "System out of memory exception". I know that on 32 bit machine I am limited up to 2 gb of process size but my developer machine is 64bit and 64 bit shouldnt have limitation. OK, I see that you are saying your Asp.net application will run 32 bit anyway even though I have 64bit machine. Therefore I am getting the exception. But what can I do to resolve that issue?
Please don't tell me that I should do local DB or some other options instead of caching into memory :) Ok, these are also other options but firs I would like to know if there is anyway to that in the memory.I need to have cache more than 2gb even.
PS, what is that "Enable the VS hosting process" option under Debug tab. does it affecting my problem? I tried checking and unchecking and nothing changed. Indeed looks like checking it works better but I still get the exception.
EDIT 1: As I found that post, it tells me that if have 32 bit application running on 64 bit OS, I should have 2800 mb max. process size but why it doesn't allow me to that and throws exception at around 1500mb.
EDIT 2: I tried adding that code in app.config of class library in which I do caching as well as into the web.config as suggested on msdn it says only framework 4.5 but I use 4.0. Is there similar hack on 4.0? because I am not sure if I should install and start using 4.5 while it is not last release.
<runtime>
<gcAllowVeryLargeObjects enabled="true" />
</runtime>
thanks for your help. Regards.
Upvotes: 2
Views: 4687
Reputation: 4141
You can set your IIS express to run 64bit in visual studio:
Go to Visual Studio - Tools - Options Menu
Choose: - Projects and Solutions, then Web Projects
tick the checkbox: "User the 64 bit version of IIS Express for web sites and projects"
No Registry edit necessary.
Upvotes: 4
Reputation: 7432
I may be mistaken, but I do believe that Webdev.webserver40.exe
(a.k.a. Cassini) is a 32-bit native C++ application.
In your asp.net web project properties page, check the box that says "Use IIS Express" and see if that resolves your issue
EDIT: Check these things as well -
Upvotes: 1