title: System out of memory exception on 64bit machine?
body: <p>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? </p>
  
  <ul>
  <li>I opened configuration manager and tried to change all class libraries as x64 but I am not able to change my main website project. that's why 64 references arent recognized on 32bit website.</li>
  </ul>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p><a href="http://blogs.msdn.com/b/tom/archive/2008/04/10/chat-question-memory-limits-for-32-bit-and-64-bit-processes.aspx" rel="nofollow">http://blogs.msdn.com/b/tom/archive/2008/04/10/chat-question-memory-limits-for-32-bit-and-64-bit-processes.aspx</a></p>
  
  <p>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 <a href="http://msdn.microsoft.com/en-us/library/hh285054%28VS.110%29.aspx" rel="nofollow">msdn</a> 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.</p>
  
  <pre><code>&lt;runtime&gt;
    &lt;gcAllowVeryLargeObjects enabled="true" /&gt;
  &lt;/runtime&gt;
  </code></pre>
  
  <p>thanks for your help.
  Regards.</p>