Global assembly cache and memory

Discussion in 'ASP .Net' started by Jerry Morton, Oct 17, 2004.

  1. Jerry Morton

    Jerry Morton Guest

    Hi,
    My ASP.NET application will be installed on multiple web sites on one
    server. This means that the application DLL will be loaded once for
    each installation - which seems inefficient. If I install the DLL in
    the Global Assembly Cache, I know it only exists in one place on disk
    but does it also mean it is only loaded in memory ONCE on the server,
    with each installation using the same in-memory copy? Are there any
    security issues or other conflicts with this (I need each site to have
    it's own worker process, file access, etc.)?

    Will I still have to install the actual ASP pages on each site?

    Thanks.
    Jerry Morton, Oct 17, 2004
    #1
    1. Advertising

  2. Jerry Morton

    Scott Allen Guest

    Hi Jerry:

    Good information on Junfeng Zhang's blog.
    http://blogs.msdn.com/junfeng/archive/2004/08/05/208375.aspx

    --
    Scott
    http://www.OdeToCode.com/

    On 17 Oct 2004 09:13:30 -0700, (Jerry Morton)
    wrote:

    >Hi,
    >My ASP.NET application will be installed on multiple web sites on one
    >server. This means that the application DLL will be loaded once for
    >each installation - which seems inefficient. If I install the DLL in
    >the Global Assembly Cache, I know it only exists in one place on disk
    >but does it also mean it is only loaded in memory ONCE on the server,
    >with each installation using the same in-memory copy? Are there any
    >security issues or other conflicts with this (I need each site to have
    >it's own worker process, file access, etc.)?
    >
    >Will I still have to install the actual ASP pages on each site?
    >
    >Thanks.
    Scott Allen, Oct 17, 2004
    #2
    1. Advertising

  3. Jerry Morton

    Jerry Morton Guest

    Hi,
    Thanks for the link - some detailed info there. I know there's not
    always an "easy" answer to questions like this and it depends on
    exactly what I'm trying to do.

    My app uses static variables and singleton objects extensively -
    Junfeng Zhang's blog says these are internal to appdomains.
    (I assume "appdomain = application instance"? i.e. per website). Other
    discussions suggest (I think) that static data is shared (i.e. stored
    once per server!?). This would cause problems for me.

    I always had the "simple" (but possibly outdated) view:

    For a individual application:
    1) DLL exists on disk!
    2) DLL is loaded into memory and NEVER changes (unless self-modifying
    code is used!)
    3) Every VARIABLE, OBJECT, etc., regardless of its
    public/private/static/singleton/session/whatever status, is unique to
    the application instance.

    So, if you put the DLL into the GAC then why can't the actual CODE
    exist only ONCE in memory with extra memory for each application
    instance to store its own state?

    I thought the GAC was:

    1) an answer to saving disk space (like DLL's used to be)
    2) a central place to JIT code so that each application doesn't have
    to do it
    3) a centralised store to ensure consistent software updates and
    side-by-side versioning

    I wrote my application to be completely independent on each site but
    now it seems I can't use the efficiencies of the GAC because my app
    won't be so "separate" between instances?

    Dazed and confused :)
    Jerry Morton, Oct 18, 2004
    #3
  4. Jerry Morton

    Scott Allen Guest

    Hi Jerry:

    Each ASP.NET web application will live in an appdomain dedicated to
    the web app. There can be mutiple appdomains inside of a single
    process, so a single asp.net worker process may host several
    applications. Still - since static variables are scoped to a single
    appdomain - each web application would have it's own single instance
    of a static.

    Don't worry about static variables being shared across the machine or
    across web applications - it definetly does not work that way!

    HTH,

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On 18 Oct 2004 02:41:31 -0700, (Jerry Morton)
    wrote:

    >Hi,
    >Thanks for the link - some detailed info there. I know there's not
    >always an "easy" answer to questions like this and it depends on
    >exactly what I'm trying to do.
    >
    >My app uses static variables and singleton objects extensively -
    >Junfeng Zhang's blog says these are internal to appdomains.
    >(I assume "appdomain = application instance"? i.e. per website). Other
    >discussions suggest (I think) that static data is shared (i.e. stored
    >once per server!?). This would cause problems for me.
    >
    >I always had the "simple" (but possibly outdated) view:
    >
    >For a individual application:
    >1) DLL exists on disk!
    >2) DLL is loaded into memory and NEVER changes (unless self-modifying
    >code is used!)
    >3) Every VARIABLE, OBJECT, etc., regardless of its
    >public/private/static/singleton/session/whatever status, is unique to
    >the application instance.
    >
    >So, if you put the DLL into the GAC then why can't the actual CODE
    >exist only ONCE in memory with extra memory for each application
    >instance to store its own state?
    >
    >I thought the GAC was:
    >
    >1) an answer to saving disk space (like DLL's used to be)
    >2) a central place to JIT code so that each application doesn't have
    >to do it
    >3) a centralised store to ensure consistent software updates and
    >side-by-side versioning
    >
    >I wrote my application to be completely independent on each site but
    >now it seems I can't use the efficiencies of the GAC because my app
    >won't be so "separate" between instances?
    >
    >Dazed and confused :)
    Scott Allen, Oct 18, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. abidali mohammad via .NET 247

    unable find assebly folder in regedit for global assembly cache

    abidali mohammad via .NET 247, Apr 10, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    804
    Maqsood Ahmed
    Apr 14, 2005
  2. JerryW
    Replies:
    7
    Views:
    1,783
    Jim Cheshire [MSFT]
    Dec 31, 2003
  3. George Durzi

    Global Assembly Cache

    George Durzi, Feb 6, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    369
    George Durzi
    Feb 6, 2004
  4. George Durzi

    Global Assembly Cache Issue

    George Durzi, May 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,716
    George Durzi
    May 28, 2004
  5. Elmo Watson
    Replies:
    0
    Views:
    550
    Elmo Watson
    Nov 9, 2007
Loading...

Share This Page