Max MB you can allocate in a single AppDomain

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ulrik@e-mail.dk

    Max MB you can allocate in a single AppDomain

    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
  • Jeroen Mostert

    #2
    Re: Max MB you can allocate in a single AppDomain

    ulrik@e-mail.dk wrote:
    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.

    --
    J.

    Comment

    Working...