views:

552

answers:

3

Hi,

What is the Maximum memory size limit for ASP.NET application on windows 2008 64bit?

Thanks, Guy Bertental

+1  A: 

The 64-bit CLR will let you see an address space of 8 TB.

Keep in mind that memory fragmentation may mean that the largest contiguous space you can allocate is significantly less.

Nick
Hmm, are you sure fragmentation matters, given the virtualization of the physical memory ranges?
Steven Sudit
Right, physical memory fragmentation does not matter, but the virtual address space can also get fragmented when a lot of small objects are allocated onto the heap, or if some objects end up in the large object heap and thus don't get garbage collected. To a great degree the CLR will take care of this but it is still possible to end up with fragementation.
Nick
+3  A: 

This is going to depend on a number of things.

  1. How much memory can a worker process on your machine use? (I believe this is 2 GB for both 32 bit and 64 bit OSes at the moment, although I could be incorrect on that)
  2. Is your application running on it's own application pool?
  3. How many worker processes are running for your application pool? (i.e. web app gardening)
Joseph
1. how do i check it?2. yes3. only 1, i didn't set web gardening
Guy Bertental
@Guy to be honest I can't find any authoritative articles on the per process memory limits. For 32 bit windows OSes its pretty clear it's 2GB. However, in the 64 bit world there seems to be a lot of grey area. I would try searching around for your specific OS's per process memory limits, since it seems to be OS specific (even inside the family so make sure to include the edition of your server i.e. web, standard, small business, etc.)
Joseph
+2  A: 

There are 2 limits

By itself, you are limited to what 64bit Windows will provide as an addressable space - that amounts to 8TB. When a future version of 64bit Windows expands that maximum you should see that immediately reflected in .NET applications running on the 64bit CLR - there is no hardcoded or .NET architectural limit within the 64bit address space.

However .NET does have a hardcoded limit of 2GB per object. About the only realistic way you can reach this is by defining really big arrays, such as new int[1000000000]. This is also the main reason for the limit (apart from some issues with memory fragmentation), as the .NET framework standard defines array indexes as an int.

David