views:

832

answers:

1

My web application crashes almost once a week due to not enought memory error. Although server has 8gb of memory and it's server 2003 x64. And almost 5gb is always free.

I compile my application with Any CPU option in studio 2008.

My laptop that i use to build this has 32 bit vista.

Is my web application running under x86 or x64?

if not running under 64bit then Will i get more memory for my web application if i compile differently? Is there any advantage with going 64 bit in .net or .net itself is limited to use specific amount of memory?

+1  A: 

If you're running out of memory in a web application, chances are you're doing something wrong. That might mean you've got leaky legacy COM objects, or you're abusing the Cache or Session, or you've got a circular reference or memory leak.

Recompiling/running as x64 could postpone the out of memory error but it won't change it.

If you compiled it on x86 but used the AnyCPU option, and deployed it to an unmodified IIS6 instance on Windows 2003, it's running as x86. You can test this assumption by looking in the Taskman on the Windows Server 2003 machine. If there is a *32 by the w3wp.exe then you're running 32-bit.

Scott Hanselman
Very true. But I've also seen situations where people use constructs which pin memory which can cause this as well. Here's a pretty cool article: https://blogs.msdn.com/yunjin/archive/2004/01/27/63642.aspx
Dave Markle