Max MB you can allocate in a single AppDomain

U

ulrik

Hi,

I've read somewhere that there is an upper limit of memory allocation
within a single AppDomain of 800 MB. Is this true?

If yes, is there anything I can do to get around this?

My multi-AppDomain service run on 32bit Win Server 2003 with 8 GB of
physical RAM and 4 cores.

Thanks in advance!
Ulrik
 
J

Jeroen Mostert

I've read somewhere that there is an upper limit of memory allocation
within a single AppDomain of 800 MB. Is this true?
No, it's not. Simple as that. Whoever came up with an 800 MB limit probably
observed that they couldn't allocate more than that on their machine, which
is possible and even likely if you've got a 32-bit machine and the
allocation is contiguous.

I don't have a sufficiently beefy machine at hand to give a practical
demonstration, but I *do* know for sure the CLR imposes no preset limits on
memory usage. The maximum amount of memory you can allocate is limited by
the OS, not the CLR.

Well, this isn't *completely* true -- if the CLR is hosted by a custom CLR
host (like SQL Server), that host can put limits on the amount of memory
managed code can allocate. For a standalone application, this doesn't matter.
My multi-AppDomain service run on 32bit Win Server 2003 with 8 GB of
physical RAM and 4 cores.
Keep in mind that your application will not be able to allocate more than 2
GB as an absolute maximum (this is including any CLR and OS structures),
because 32-bit processes cannot access more than that unless they use tricks
like AWE (for which the CLR has no support). This is irrespective of how you
use AppDomains, which are invisible to the OS.

Booting with /3GB will give you an extra gigabyte of address space per
process but comes with its own pitfalls. If you need more memory than this
in a single application, moving to 64-bit is recommended.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top