Memory issues

Discussion in 'ASP.NET 2.0' started by shimon, May 4, 2006.

  1. My application seem to have memory issues. The application process seem to be recycled every 20s.
    I don't seem to put big objects in Session for sure not every 10-20s.
    My database code (usually) looks like this



    if (!IsPostBack)


    {


    using (IDataReader rd = Customer.List())


    {


    grvList.DataSource = rd;


    grvList.DataBind();


    }


    }


    And I am using MS Enterprise Lib 1.1 (yes 1.1 for ASP.NET2.0 application).


    So connections should be closed.


    Any suggestions?


    Thanks,


    Shimon.
     
  2. Connections should _always_ be closed, yes.



    Recycling every 20 seconds seems to be quite excessive. What is your application doing?


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  3. Nothing major. Just some business process management. Processing orders, viewing customers.


    I looked on my machine amount of connections never goes over 3 (I just made it two ).


    What I do see on my machine that process CPU jumps when I go to the page. I am not sure if this could be due to compiling of asp.net 2.0. So if two users go to different not yet compiled pages that I may be in trouble due to application recycling.


    Any thoughts?


    Thanks.


    (It is major for me - risk N1)
     
  4. I dont think the compilation would cause your process to recycle, otherwise every site would have this problem.


    3 Open connections shouldn't cause this problem.


    How do you know the application is actually being recycled?


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  5. It throws me out to login page.


    Also on Perfomance Explorer I see that DB Server connections go to 0.


    Memory for the process stays the same (strange).


    The may reason I contacted tech support and that what they suggested.


    Thank you.
     
  6. Bruce

    Bruce DiscountASP.NET Staff

    Another possible reason is that the process crashed for some reason!!

    I can't really tell from the error though.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  7. Thank you for follow up.
    After two days of thinking my humble opinion is that it is due to first time compiling of the requested page.
    I am not sure if process actually aborts or asp.net just locks it due to compilation.
    In version 1.1 it was clear if you updated assembly in bin all the users will be thrown out to log in page.
    Here in 2.0I am not sure - we get assembly per page. I do find in development that sometimes it throws me out if I make changes to asp.cs file and then refresh page. So my assumption is that there is something to do with compilation.
    Also the users of my applicatoin reported that they don't see it anymore.

    I would still appriciate if somebody has clear knowladge on the issue.
    Thank you,
    Shimon
     
  8. If you do not pre-compile your pages, a simple change to a .cs file would cause the server to recompile your entire app. Your site's worker process will not necessarily recycle, but the AppDomain within the worker process will. This will still cause a loss of session nonetheless. If you're worried about loss of sessions, I recommend storing session data in SQL.

    There have also been reports of the AppDomain recycling randomly, like if you delete a directory or when creating a lot of files quickly.
    http://blogs.msdn.com/toddca/archive/2005/12/01/499144.aspx
    http://weblogs.asp.net/owscott/archive/2006/02/21/438678.aspx

    Microsoft seems to have this bug fixed. We'll have to wait and see in the next framework service pack.
    http://lab.msdn.microsoft.com/produ...edbackid=915df7c2-1346-42dd-922d-d563232c053a

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  9. Thanks.
     

Share This Page