AJAX ScriptManager Memory Leak

Discussion in 'ASP .Net' started by =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=, Jul 3, 2007.

  1. Hi!

    I know this topic has been discussed a long way, but I haven't found any
    apparent solution (maybe I shouldn't be looking for a one :)) I have a very
    simple application with one page and with just ScriptManager object in it.
    Every time I refresh the page the memory usage goes up. I have AJAX
    extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem, and
    how did you guys cope with this problem?

    Please reply asap... i am in emergency

    Thanks
     
    =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=, Jul 3, 2007
    #1
    1. Advertising

  2. I would not panic about memory usage until you know what is happening. By
    default, .NET uses memory until it needs it. While this seems like an issue,
    it is actually more efficient to leave memory in use than to clear it
    immediately after use. As long as the application does not exhibit issues
    under load, I would not panic (consider downloading something like the Web
    Application Stress Tool - free from MS).

    Memory is eventually "garbage collected", but it waits until it needs
    memory.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    http://gregorybeamer.spaces.live.com
    Co-author: Microsoft Expression Web Bible (upcoming)

    ************************************************
    Think outside the box!
    ************************************************
    "Nikolay Evseev"
    <> wrote in
    message news:...
    > Hi!
    >
    > I know this topic has been discussed a long way, but I haven't found any
    > apparent solution (maybe I shouldn't be looking for a one :)) I have a
    > very
    > simple application with one page and with just ScriptManager object in it.
    > Every time I refresh the page the memory usage goes up. I have AJAX
    > extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem,
    > and
    > how did you guys cope with this problem?
    >
    > Please reply asap... i am in emergency
    >
    > Thanks
     
    Cowboy \(Gregory A. Beamer\), Jul 3, 2007
    #2
    1. Advertising

  3. The problem is with my client who is requiring this issue to be fixed asap.
    And it does prove to be an issue since the end user may have the same page
    opened for days without closing it. All users connect to this application via
    citrix (just the way they work, I can't force them to change) and therefore
    the memory usage issue becomes crucial.
    I've read on some forums that this is due to AJAX not disposing off it's own
    objects properly.
    But why this works fine on some machines and doesn't on the others. Is it to
    do with the fact that older machines have traces of previous ajax versions?

    "Cowboy (Gregory A. Beamer)" wrote:

    > I would not panic about memory usage until you know what is happening. By
    > default, .NET uses memory until it needs it. While this seems like an issue,
    > it is actually more efficient to leave memory in use than to clear it
    > immediately after use. As long as the application does not exhibit issues
    > under load, I would not panic (consider downloading something like the Web
    > Application Stress Tool - free from MS).
    >
    > Memory is eventually "garbage collected", but it waits until it needs
    > memory.
    >
    > --
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    > http://gregorybeamer.spaces.live.com
    > Co-author: Microsoft Expression Web Bible (upcoming)
    >
    > ************************************************
    > Think outside the box!
    > ************************************************
    > "Nikolay Evseev"
    > <> wrote in
    > message news:...
    > > Hi!
    > >
    > > I know this topic has been discussed a long way, but I haven't found any
    > > apparent solution (maybe I shouldn't be looking for a one :)) I have a
    > > very
    > > simple application with one page and with just ScriptManager object in it.
    > > Every time I refresh the page the memory usage goes up. I have AJAX
    > > extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem,
    > > and
    > > how did you guys cope with this problem?
    > >
    > > Please reply asap... i am in emergency
    > >
    > > Thanks

    >
    >
    >
     
    =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=, Jul 3, 2007
    #3
  4. He was talking about JavaScript memory leaks not server side.

    George.

    "Cowboy (Gregory A. Beamer)" <> wrote in
    message news:%23%...
    >I would not panic about memory usage until you know what is happening. By
    >default, .NET uses memory until it needs it. While this seems like an
    >issue, it is actually more efficient to leave memory in use than to clear
    >it immediately after use. As long as the application does not exhibit
    >issues under load, I would not panic (consider downloading something like
    >the Web Application Stress Tool - free from MS).
    >
    > Memory is eventually "garbage collected", but it waits until it needs
    > memory.
    >
    > --
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    > http://gregorybeamer.spaces.live.com
    > Co-author: Microsoft Expression Web Bible (upcoming)
    >
    > ************************************************
    > Think outside the box!
    > ************************************************
    > "Nikolay Evseev"
    > <> wrote in
    > message news:...
    >> Hi!
    >>
    >> I know this topic has been discussed a long way, but I haven't found any
    >> apparent solution (maybe I shouldn't be looking for a one :)) I have a
    >> very
    >> simple application with one page and with just ScriptManager object in
    >> it.
    >> Every time I refresh the page the memory usage goes up. I have AJAX
    >> extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem,
    >> and
    >> how did you guys cope with this problem?
    >>
    >> Please reply asap... i am in emergency
    >>
    >> Thanks

    >
    >
     
    George Ter-Saakov, Jul 3, 2007
    #4
  5. =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=

    Chad Scharf Guest

    From the Mix 07 event I asked the same question of a few of the speakers and
    got a few simple answers of the client object model, especially of IE and
    memory usage and the disposable model through JavaScript.

    1. Ensure you are not using ANY inline JavaScript on your page, this can
    prevent execution of any AJAX related Dispose methods. This is of course
    unless it can dispose of itself.

    2. Ensure any other .js or other script files you register on the page are
    done within the ScriptManager and not in the head tag. This is important so
    the ScriptManager can control how to manage the client side memory and
    loading those scripts and in what order they should be loaded in relation
    with the AJAX client side libraries.

    3. Only use the ScriptManager on a page if you really need it. You said you
    only have a ScriptManager on that page, why? Do you have an UpdatePanel
    control, are you using the AJAX client side libraries for your own scripts,
    are you using the Animation libraries? If you are using those, are you
    implementing the disposable pattern properly?

    "Nikolay Evseev"
    <> wrote in
    message news:...
    > Hi!
    >
    > I know this topic has been discussed a long way, but I haven't found any
    > apparent solution (maybe I shouldn't be looking for a one :)) I have a
    > very
    > simple application with one page and with just ScriptManager object in it.
    > Every time I refresh the page the memory usage goes up. I have AJAX
    > extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem,
    > and
    > how did you guys cope with this problem?
    >
    > Please reply asap... i am in emergency
    >
    > Thanks
     
    Chad Scharf, Jul 3, 2007
    #5
  6. The original problem occurs in the real world application with at least an
    updatepanel on the page. I am talking here about a simple sample application
    which everyone here can easily reproduce. One thing is becoming obvious for
    me - memory leaks occurs on those client machines where a previous version of
    ajax/atlas was used. Freshly installed pcs don't seem to have the same
    problem.

    Any more thoughts? Anyone knows how to get rid of traces of previous ajax
    versions on client machines?

    Maybe there is a possibility of writing some onunload javascript handler
    where a manual script will null all unused references?

    Regards,
    Nikolay

    "Chad Scharf" wrote:

    > From the Mix 07 event I asked the same question of a few of the speakers and
    > got a few simple answers of the client object model, especially of IE and
    > memory usage and the disposable model through JavaScript.
    >
    > 1. Ensure you are not using ANY inline JavaScript on your page, this can
    > prevent execution of any AJAX related Dispose methods. This is of course
    > unless it can dispose of itself.
    >
    > 2. Ensure any other .js or other script files you register on the page are
    > done within the ScriptManager and not in the head tag. This is important so
    > the ScriptManager can control how to manage the client side memory and
    > loading those scripts and in what order they should be loaded in relation
    > with the AJAX client side libraries.
    >
    > 3. Only use the ScriptManager on a page if you really need it. You said you
    > only have a ScriptManager on that page, why? Do you have an UpdatePanel
    > control, are you using the AJAX client side libraries for your own scripts,
    > are you using the Animation libraries? If you are using those, are you
    > implementing the disposable pattern properly?
    >
    > "Nikolay Evseev"
    > <> wrote in
    > message news:...
    > > Hi!
    > >
    > > I know this topic has been discussed a long way, but I haven't found any
    > > apparent solution (maybe I shouldn't be looking for a one :)) I have a
    > > very
    > > simple application with one page and with just ScriptManager object in it.
    > > Every time I refresh the page the memory usage goes up. I have AJAX
    > > extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem,
    > > and
    > > how did you guys cope with this problem?
    > >
    > > Please reply asap... i am in emergency
    > >
    > > Thanks

    >
    >
    >
     
    =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=, Jul 3, 2007
    #6
  7. =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=

    Chad Scharf Guest

    As far as I know there is no real way to do this other than requesting that
    the client completely nuke thier temporary internet file store/cache. The
    client libraries are simply javascript files and are not really in the .NET
    framework on the client machine (until Silverlight becomes more widely
    adopted that is). The browser hooks that the script uses cached by the
    browser similar to any sites referenced scripts.

    Perhaps you can have them try this, unless you already have which I imagine
    you have. Perhaps someone else has another idea. Sorry, I misunderstood the
    underlying probable cause.

    -- Chad

    "Nikolay Evseev"
    <> wrote in
    message news:...
    > The original problem occurs in the real world application with at least an
    > updatepanel on the page. I am talking here about a simple sample
    > application
    > which everyone here can easily reproduce. One thing is becoming obvious
    > for
    > me - memory leaks occurs on those client machines where a previous version
    > of
    > ajax/atlas was used. Freshly installed pcs don't seem to have the same
    > problem.
    >
    > Any more thoughts? Anyone knows how to get rid of traces of previous ajax
    > versions on client machines?
    >
    > Maybe there is a possibility of writing some onunload javascript handler
    > where a manual script will null all unused references?
    >
    > Regards,
    > Nikolay
    >
    > "Chad Scharf" wrote:
    >
    >> From the Mix 07 event I asked the same question of a few of the speakers
    >> and
    >> got a few simple answers of the client object model, especially of IE and
    >> memory usage and the disposable model through JavaScript.
    >>
    >> 1. Ensure you are not using ANY inline JavaScript on your page, this can
    >> prevent execution of any AJAX related Dispose methods. This is of course
    >> unless it can dispose of itself.
    >>
    >> 2. Ensure any other .js or other script files you register on the page
    >> are
    >> done within the ScriptManager and not in the head tag. This is important
    >> so
    >> the ScriptManager can control how to manage the client side memory and
    >> loading those scripts and in what order they should be loaded in relation
    >> with the AJAX client side libraries.
    >>
    >> 3. Only use the ScriptManager on a page if you really need it. You said
    >> you
    >> only have a ScriptManager on that page, why? Do you have an UpdatePanel
    >> control, are you using the AJAX client side libraries for your own
    >> scripts,
    >> are you using the Animation libraries? If you are using those, are you
    >> implementing the disposable pattern properly?
    >>
    >> "Nikolay Evseev"
    >> <> wrote in
    >> message news:...
    >> > Hi!
    >> >
    >> > I know this topic has been discussed a long way, but I haven't found
    >> > any
    >> > apparent solution (maybe I shouldn't be looking for a one :)) I have a
    >> > very
    >> > simple application with one page and with just ScriptManager object in
    >> > it.
    >> > Every time I refresh the page the memory usage goes up. I have AJAX
    >> > extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem,
    >> > and
    >> > how did you guys cope with this problem?
    >> >
    >> > Please reply asap... i am in emergency
    >> >
    >> > Thanks

    >>
    >>
    >>
     
    Chad Scharf, Jul 3, 2007
    #7
  8. I have tried deleting all temporary files myself on my machine, but anyway no
    luck.

    Microsoft guys! Do you want to contribute to this chain? I am sure you've
    been asked about this problem not once?

    Thanks in advance,
    Nikolay

    "Chad Scharf" wrote:

    > As far as I know there is no real way to do this other than requesting that
    > the client completely nuke thier temporary internet file store/cache. The
    > client libraries are simply javascript files and are not really in the .NET
    > framework on the client machine (until Silverlight becomes more widely
    > adopted that is). The browser hooks that the script uses cached by the
    > browser similar to any sites referenced scripts.
    >
    > Perhaps you can have them try this, unless you already have which I imagine
    > you have. Perhaps someone else has another idea. Sorry, I misunderstood the
    > underlying probable cause.
    >
    > -- Chad
    >
    > "Nikolay Evseev"
    > <> wrote in
    > message news:...
    > > The original problem occurs in the real world application with at least an
    > > updatepanel on the page. I am talking here about a simple sample
    > > application
    > > which everyone here can easily reproduce. One thing is becoming obvious
    > > for
    > > me - memory leaks occurs on those client machines where a previous version
    > > of
    > > ajax/atlas was used. Freshly installed pcs don't seem to have the same
    > > problem.
    > >
    > > Any more thoughts? Anyone knows how to get rid of traces of previous ajax
    > > versions on client machines?
    > >
    > > Maybe there is a possibility of writing some onunload javascript handler
    > > where a manual script will null all unused references?
    > >
    > > Regards,
    > > Nikolay
    > >
    > > "Chad Scharf" wrote:
    > >
    > >> From the Mix 07 event I asked the same question of a few of the speakers
    > >> and
    > >> got a few simple answers of the client object model, especially of IE and
    > >> memory usage and the disposable model through JavaScript.
    > >>
    > >> 1. Ensure you are not using ANY inline JavaScript on your page, this can
    > >> prevent execution of any AJAX related Dispose methods. This is of course
    > >> unless it can dispose of itself.
    > >>
    > >> 2. Ensure any other .js or other script files you register on the page
    > >> are
    > >> done within the ScriptManager and not in the head tag. This is important
    > >> so
    > >> the ScriptManager can control how to manage the client side memory and
    > >> loading those scripts and in what order they should be loaded in relation
    > >> with the AJAX client side libraries.
    > >>
    > >> 3. Only use the ScriptManager on a page if you really need it. You said
    > >> you
    > >> only have a ScriptManager on that page, why? Do you have an UpdatePanel
    > >> control, are you using the AJAX client side libraries for your own
    > >> scripts,
    > >> are you using the Animation libraries? If you are using those, are you
    > >> implementing the disposable pattern properly?
    > >>
    > >> "Nikolay Evseev"
    > >> <> wrote in
    > >> message news:...
    > >> > Hi!
    > >> >
    > >> > I know this topic has been discussed a long way, but I haven't found
    > >> > any
    > >> > apparent solution (maybe I shouldn't be looking for a one :)) I have a
    > >> > very
    > >> > simple application with one page and with just ScriptManager object in
    > >> > it.
    > >> > Every time I refresh the page the memory usage goes up. I have AJAX
    > >> > extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem,
    > >> > and
    > >> > how did you guys cope with this problem?
    > >> >
    > >> > Please reply asap... i am in emergency
    > >> >
    > >> > Thanks
    > >>
    > >>
    > >>

    >
    >
    >
     
    =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=, Jul 3, 2007
    #8
  9. =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=

    marss Guest

    Nikolay Evseev wrote:
    > Hi!
    >
    > I know this topic has been discussed a long way, but I haven't found any
    > apparent solution (maybe I shouldn't be looking for a one :)) I have a very
    > simple application with one page and with just ScriptManager object in it.
    > Every time I refresh the page the memory usage goes up. I have AJAX
    > extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem, and
    > how did you guys cope with this problem?
    >
    > Please reply asap... i am in emergency
    >
    > Thanks


    Hi,
    Try to use a few small update panels instead of single large one if
    your program logic allows it. It can slightly soften problem.

    This is not particular AJAX problem, it is common IE problem. It is
    not designed to work without refreshing page for days.
    http://msdn2.microsoft.com/en-us/library/bb250448.aspx

    Regards, Mykola
    http://marss.co.ua
     
    marss, Jul 4, 2007
    #9
  10. The page that the client is having the problem with contains only one
    updatepanel with a gridview in it.

    One more thing - when you minimize the IE window, memory goes back to normal

    "marss" wrote:

    >
    > Nikolay Evseev wrote:
    > > Hi!
    > >
    > > I know this topic has been discussed a long way, but I haven't found any
    > > apparent solution (maybe I shouldn't be looking for a one :)) I have a very
    > > simple application with one page and with just ScriptManager object in it.
    > > Every time I refresh the page the memory usage goes up. I have AJAX
    > > extenstions 1.0 installed and IE7 on winxp. Is this IE or AJAX problem, and
    > > how did you guys cope with this problem?
    > >
    > > Please reply asap... i am in emergency
    > >
    > > Thanks

    >
    > Hi,
    > Try to use a few small update panels instead of single large one if
    > your program logic allows it. It can slightly soften problem.
    >
    > This is not particular AJAX problem, it is common IE problem. It is
    > not designed to work without refreshing page for days.
    > http://msdn2.microsoft.com/en-us/library/bb250448.aspx
    >
    > Regards, Mykola
    > http://marss.co.ua
    >
    >
     
    =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=, Jul 4, 2007
    #10
  11. =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=

    marss Guest

    Nikolay Evseev wrote:

    > One more thing - when you minimize the IE window, memory goes back to normal


    Nice solution. Add this to the program manual :)
     
    marss, Jul 4, 2007
    #11
  12. We are seriously considering this :)



    "marss" wrote:

    >
    > Nikolay Evseev wrote:
    >
    > > One more thing - when you minimize the IE window, memory goes back to normal

    >
    > Nice solution. Add this to the program manual :)
    >
    >
     
    =?Utf-8?B?Tmlrb2xheSBFdnNlZXY=?=, Jul 4, 2007
    #12
    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. Elmo Watson
    Replies:
    1
    Views:
    373
  2. =?Utf-8?B?TGFycnkgRXBu?=

    Ajax - Master Pages - ScriptManager - Web User Controls

    =?Utf-8?B?TGFycnkgRXBu?=, Feb 23, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    858
    Walter Wang [MSFT]
    Feb 26, 2007
  3. Steve Kershaw

    AJAX in ASP.Net ScriptManager error

    Steve Kershaw, Apr 25, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    470
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 25, 2007
  4. Ryan
    Replies:
    0
    Views:
    428
  5. asp.net ajax
    Replies:
    2
    Views:
    1,608
    Gregory A. Beamer
    Dec 21, 2009
Loading...

Share This Page