OutOfMemoryException

Discussion in 'ASP .Net' started by Hardy Wang, Feb 1, 2006.

  1. Hardy Wang

    Hardy Wang Guest

    Hi,
    We have a production web server machine, running Win2K + SP4 / IIS 5.0 /
    ASP.NET 1.1, it has 2 GB of physical memory.

    With the default value of <processModel memoryLimit="60"> of
    machine.config, we constantly get OutOfMemoryExcption, then we adjusted the
    value to 25, it works fine. If we adjust to 30, we still get this exception.

    It looks like when aspnet work process consumes only up to 500MB RAM,
    every number beyond that is not accessible by ASP.NET. But we do have 2GB
    RAM on the server, and from Task Manager we can see there is quite a lot of
    free memory available.

    Any reason why ASP.NET does not like to cunsume more memory? Thanks for
    any suggestion.

    --
    WWW: http://hardywang.1accesshost.com
    ICQ: 3359839
    yours Hardy
     
    Hardy Wang, Feb 1, 2006
    #1
    1. Advertising

  2. Hi Hardy,

    Welcome to the MSDN newsgroup.

    From your description, one of your ASP.NET web application(deployed on
    production server?) is suffering OutOfMemory exception recently. Also, you
    found that this occurs when the processModel's memoryLimit is enlarged
    above a certain value, correct?

    Based on my experience, this is likely memory leak issue and the OOM
    exception occur when you enlarge the "memoryLimit" setting is because there
    is leaked memory or memory fragement which cause the system unable to
    allocate new block of memory before we make full use of the total physical
    memory. For such issue, it'll be hard to directly address the root cause.
    Is the web application just deployed recently or has been deployed for long
    time and just suffers the problem recently? Here are some general setting
    and things we can check first:

    1. Locate the <compilation> element in your asp.net application's
    web.config file, check the "debug" attribute to see whether it is set to
    false. When "debug" attribute is set to "true", the asp.net runtime won't
    batch compile the dynamic page classes and assemblies which may easily
    cause heap fragment......

    2. If possible, we can try isolate the problem to some certain pages
    (lookup the private bytes in peformance counters) which is likely lead to
    the problem.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Feb 2, 2006
    #2
    1. Advertising

  3. Hardy Wang

    Hardy Wang Guest

    Thanks Steve,
    Let me describe my problem more detail.
    Our server seems not to be able to recycle the work process when it hits
    the memory limitation when we set value to greater than 30. If we set to 25,
    when can see work process is recycled and a new one is created
    automatically.
    We host about 20 web applications on this server, some of them are quite
    busy, while others are not visited so frequently. Whenever
    OutOfMomoryException was thrown, all of the applications suffered at the
    same time.

    Anyway, thanks for your suggestion of "Debug", I definitely will look
    into. And we will keep monitoring the system.

    --
    WWW: http://hardywang.1accesshost.com
    ICQ: 3359839
    yours Hardy
    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi Hardy,
    >
    > Welcome to the MSDN newsgroup.
    >
    > From your description, one of your ASP.NET web application(deployed on
    > production server?) is suffering OutOfMemory exception recently. Also, you
    > found that this occurs when the processModel's memoryLimit is enlarged
    > above a certain value, correct?
    >
    > Based on my experience, this is likely memory leak issue and the OOM
    > exception occur when you enlarge the "memoryLimit" setting is because
    > there
    > is leaked memory or memory fragement which cause the system unable to
    > allocate new block of memory before we make full use of the total physical
    > memory. For such issue, it'll be hard to directly address the root cause.
    > Is the web application just deployed recently or has been deployed for
    > long
    > time and just suffers the problem recently? Here are some general setting
    > and things we can check first:
    >
    > 1. Locate the <compilation> element in your asp.net application's
    > web.config file, check the "debug" attribute to see whether it is set to
    > false. When "debug" attribute is set to "true", the asp.net runtime
    > won't
    > batch compile the dynamic page classes and assemblies which may easily
    > cause heap fragment......
    >
    > 2. If possible, we can try isolate the problem to some certain pages
    > (lookup the private bytes in peformance counters) which is likely lead to
    > the problem.
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
     
    Hardy Wang, Feb 2, 2006
    #3
  4. Thanks for reply Hardy,

    Yes, as for the

    ========================
    Our server seems not to be able to recycle the work process when it hits
    the memory limitation when we set value to greater than 30. If we set to
    25,
    when can see work process is recycled and a new one is created
    automatically.
    ========================

    it is just because the memory issue like heap fragment make the availabe
    free memory blocks be occupied and if the memory limitation setting is not
    greater than 30 (in yoru case) , the asp.net will recycle the worker
    process so that you won't encounter the OOM exception, if the setting is
    greater, the worker process won't recycle and the memory issue become
    serious and finally it raise OOM exception.

    Anyway, if there're any new update, please feel free to post here.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Feb 3, 2006
    #4
  5. Hardy Wang

    brianfairchild

    Joined:
    Jun 3, 2008
    Messages:
    1
    OOM - Stupid, but check

    So I had been dealing with this issue in pages where I dynamically add controls to pages. For example, I have a page that renders itself completely, with events, based on an XML file.

    In certain situations If the XML file was large and therefore a lot of controls were to be built on the page I would see my memory spike until I got an OOM.

    Trace. I had forgotten to turn trace off, and better yet I had set it to 1000 requests. So, since my code was so dynamic a ton of information was being written to trace and therefore consuming memory like a Thanksgiving dinner!

    Make sure you turn trace off in production!

    hth
     
    brianfairchild, Jun 3, 2008
    #5
    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. =?Utf-8?B?UmlwdWwgSGFuZGE=?=

    Base Exception:System.OutOfMemoryException error message

    =?Utf-8?B?UmlwdWwgSGFuZGE=?=, Nov 17, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,036
    Natty Gur
    Nov 18, 2003
  2. =?Utf-8?B?amF6?=

    OutOfMemoryException

    =?Utf-8?B?amF6?=, Dec 10, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    365
    =?Utf-8?B?SmF6?=
    Dec 16, 2003
  3. Pyramis
    Replies:
    0
    Views:
    426
    Pyramis
    Jan 25, 2004
  4. =?Utf-8?B?U3Rhbg==?=

    Exception of type System.OutOfMemoryException is thrown

    =?Utf-8?B?U3Rhbg==?=, Feb 16, 2004, in forum: ASP .Net
    Replies:
    11
    Views:
    28,073
    Ken Cox [Microsoft MVP]
    Dec 28, 2004
  5. Versteijn
    Replies:
    7
    Views:
    20,221
    Denzien
    Mar 7, 2008
Loading...

Share This Page