开发者

How can I debug this memory usage / dom usage increase in my JS/Update panel site

I'm hoping some Javascript/ASP.Net gurus can give me some hints here.

I've written an application which (unfortunately) uses UpdatePanel (yes, I'm aware that was a dumb idea, too late now though, I understand it more now - even though its an intranet site I'm having troubles with it)

The site is a web based timesheet site, kind of tabular format. Anyhow, it basically saves everything in it in an update panel, and autosaves once a minute. This seems to work fine for me, but I use firefox. Other users with more timesheet entries, and IE7 have problems with IE memory usage increasing and their browser slowing down.

I ran Sieve (checks for memory leaks on a website) and it was pretty obvious it was bad: alt text http://rodh.org/images/Programming/sievemain.png

Thats my site loaded up and left running for a bit, refreshed it at the dip and left it and you can see once a minute it jumps up a little bit. THe area on the timeline before the dip was when i was hitting the save button a bit, so its obvious what is causing it. The DOM nodes and memory both go up.

I'm using a ScriptManager.RegisterClientScriptBlock's (mainly to get the clientID's of controls so I can do javascript totals) and also a ScriptManager.RegisterStartup开发者_Go百科Script on page_load to get set the focus to be the same after a partial postback. Maybe they are contributing?

Is there any tools that can help me out further to this? Sieve reported alot of empty divs being made when the postback occurs? bit I've never used sieve before so maybe this always happens? alt text http://rodh.org/images/Programming/sievnodes.png

Is there some sort of code analysis I can do, or something that at least lets me see the new DOM nodes created each time...

I'm thinking hte problem might be to do with my code behind hackery to get the client id's, it stores them in an array, and then recreates taht array on each postback, perhaps something is going wrong there? I've uploaded my JS file which does that hackery, and also the code behind in case anyone needs more info. http://rodh.org/images/Programming/javascript.txt http://rodh.org/images/Programming/codebehind.txt

So I guess my question is: - Can anyone think of anything immediately that would be causing this? - what are some common causes of increased DOM usage on UpdatePanels (using Jquery too btw) - what tools can I use to debug?


I can tell you first hand Microsoft knows about the IE problem(KB 2000262) with UpdatePanels. Its a DOM parser issue. I had a site that ran fine up until a certain page content size and then IE(all versions) had a fit. FF and other browsers handled the same pages with ease.

Things I did to make my pages faster:

  • Use UpdateMode=Conditional wherever possible
  • Implement the KB 2000262 fix

UpdatePanel Async Postsback slow in IE…Part 3

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜