none
AppDomain and Process address space RRS feed

  • Question

  • Hi,

     

    How is process address space shared between AppDomains?

    Say that I have a process and 2 AppDomains. Then on 32-bit machine

    does each AppDoamin get 2GB space? or each will get 1 GB each?

     

    How this works ona  64 bit machine?

     

    Wednesday, July 6, 2011 6:29 PM

Answers

  • The process gets 2GB space.  It's not divided up, but rather more just allocated as requested by either AppDomain.  A single AppDomain could use up the entire thing, or they could be shared equally, depending on which requests memory (and when it's requested).

     

    On a 64bit machine, it's the same if it's a 32bit process.  If it's a 64bit process, the memory limits are much, much higher, so it's typically not an issue.  (The process can use all of the memory on the system until it runs out - so either appdomain can request it).

     

     


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Marked as answer by Kesavananad Thursday, July 7, 2011 5:23 AM
    Wednesday, July 6, 2011 7:26 PM
    Moderator

All replies

  • The process gets 2GB space.  It's not divided up, but rather more just allocated as requested by either AppDomain.  A single AppDomain could use up the entire thing, or they could be shared equally, depending on which requests memory (and when it's requested).

     

    On a 64bit machine, it's the same if it's a 32bit process.  If it's a 64bit process, the memory limits are much, much higher, so it's typically not an issue.  (The process can use all of the memory on the system until it runs out - so either appdomain can request it).

     

     


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Marked as answer by Kesavananad Thursday, July 7, 2011 5:23 AM
    Wednesday, July 6, 2011 7:26 PM
    Moderator
  • Memory allocation is done by the CLR, which moves things around when needed, so there is no fixed address block to talk about. Appdomains do not get address space, address is associated with the process.

    For more help in CLR visit the CLR forum under the .Net category, your question has nothing to do with syntax or keywords defined in the C# language standard.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP

    Wednesday, July 6, 2011 7:27 PM
  • Hi,

    Thank you very much for the answer. It cleared the skies. Are there any MSDN links that you can point to me on this topic (AppDomain and Process Address space)?

    Thanks,

    Kesav

    Thursday, July 7, 2011 5:31 AM
  • I don't know. It would be up to the CLR to decide how to allocate memory. For example SQL's CLR for managed stored procedures behaves differently than the one for managed applications.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Thursday, July 7, 2011 7:13 PM