AJAX ScriptManager Memory Leak

G

Guest

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
 
C

Cowboy \(Gregory A. Beamer\)

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.


"Nikolay Evseev"
 
G

Guest

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?
 
G

George Ter-Saakov

He was talking about JavaScript memory leaks not server side.

George.
 
C

Chad Scharf

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"
 
G

Guest

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
 
C

Chad Scharf

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"
 
G

Guest

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
 
M

marss

Nikolay said:
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
 
G

Guest

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top