[ 7 posts ]

Bablu Dutt. K

  • Username: babludutt
  • Joined: Tue Aug 07, 2012 1:56 am
  • Posts: 4
  • GitHub: yuibeginner
  • Gists: yuibeginner
  • IRC: Bablu
  • Offline
  • Profile

Memory leakage issue in IE

Post Posted: Tue Aug 07, 2012 2:27 am
+0-
Hi All,

I'm using a scrollable datatable in our project to display a set of 100 plus records (dynamic).

The first column is a link upon clicking of which it opens up a popup (panel) which shows a lot more data.

I do the following:

1) I sort the grid using any column
2) Click on the first column to open up the panel
3) Close the panel using the close button.

Immediately I get an error in IE browser:

A script on this page is causing Internet Explorer to run slowly.

I'm using the YUI version 2.8.2r1.

I read the related tickets on this issue but none could actually fix the problem.
I have not been able to isolate the problem if it's an issue with the Panel (since I'm opening & closing the Panel with considerable amount of data) or a data table issue reported elsewhere.

When I'm closing the Panel on the hideEvent I'm destroying the panel using panel.destroy() method.

I checked the release notes of 2.8.0 where I found this:

■Enhancements
■DropdownCellEditor now supports multiple and size properties.
■Calling DataTable's destroy() method now calls Paginator destroy(), when applicable.
■Added beforeRenderEvent.
■Added clearScrollPositions() and scrollTo() to ScrollingDataTable.
■Performance improvements for ScrollingDataTable in IE.
■Bug Fixes
■Bug fixes for DataTables rendered within table markup.

I'm not sure what exactly was fixed here. But the problem is easily reproducible in almost all the places where we use a datatable.

Your help is appreciated.

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Memory leakage issue in IE

Post Posted: Tue Aug 07, 2012 7:51 am
+0-
Your title mentions "memory leakage" but the error message you quote is about some script running too slow. I'll stick with the error message.

It is not a good idea to create and destroy any widget, Panels or whatever. It is better to make them invisible when not needed and replace the contents and show them when required.

I don't see how the error can be related to the DataTable since it happens when you close the panel, not when doing anything about the DataTable itself. I don't know how the first two steps are related with the error reported. Can you repeatedly do any of the steps on its own, without the others, and check which one is the responsible?

Bablu Dutt. K

  • Username: babludutt
  • Joined: Tue Aug 07, 2012 1:56 am
  • Posts: 4
  • GitHub: yuibeginner
  • Gists: yuibeginner
  • IRC: Bablu
  • Offline
  • Profile

Re: Memory leakage issue in IE

Post Posted: Wed Aug 08, 2012 1:27 am
+0-
The close button scenario is one of an instance where I'm getting the error message.

I do get the same error message few times when the panel is closed and I try to click on the link on the table again.

Can you tell me how is it different if I just hide the panel as you pointed out and also when I destroy the panel each time?

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Memory leakage issue in IE

Post Posted: Wed Aug 08, 2012 11:35 pm
+0-
hiding a panel simply adds a CSS display:none to the container. That is fast. Destroying it and re-creating it is slower since it needs to do much more than that.

However, such destruction and creation does not justify does not justify the error you are getting. If the panel contains a lot of information, I would suspect it is that. How do you create it? Doing individual DOM operations is terribly slow, if you are using createElement and appendChild to create that content, that could well be the culprit.

Concatenate everything into am HTML string and insert it into the panel, that should be faster.

Anyway, this is not a DataTable issue and is not a memory leakage issue.

Bablu Dutt. K

  • Username: babludutt
  • Joined: Tue Aug 07, 2012 1:56 am
  • Posts: 4
  • GitHub: yuibeginner
  • Gists: yuibeginner
  • IRC: Bablu
  • Offline
  • Profile

Re: Memory leakage issue in IE

Post Posted: Thu Aug 09, 2012 12:40 am
+0-
The content on the panel is huge, we have 2 grids bound to 2 datatables displayed in it and a lot of div bound to the data in the datatable.

On the click of the link on each row in the base page grid, wee load the xxx.html page which is loaded first, then there are 2 grids bound using the datatable and is rendered on to the divs inside the loaded html. Then we have lot of Dom elements that is being assigned on the click of a row in the grid. So it won't be possible to assign everything in an innerHTML.

Please note: When we used firefox the memory consumption is pretty less, whereas in IE it is huge. That was one of the reason that I felt it could have something to do with the memory leakage issue mentioned in the site.

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Memory leakage issue in IE

Post Posted: Thu Aug 09, 2012 6:49 am
+0-
The it will be slow, and with slow browsers it will be slower still. Perhaps a redesign is in order. I'm sorry, I don't think anyone can provide any more help. If you combine a huge page with a slow browser, it is not going to work fast. As I said, a good idea is reuse as much as you can so that little gets destroyed and recreated. Try to replace the contents in your components as much as possible while hidden. There are several techniques to speed things up, but they depend on your code and, if your code is huge, I don't think anybody will have spare time to look into it, sorry.

The best technique, however, is to make things simple.

Bablu Dutt. K

  • Username: babludutt
  • Joined: Tue Aug 07, 2012 1:56 am
  • Posts: 4
  • GitHub: yuibeginner
  • Gists: yuibeginner
  • IRC: Bablu
  • Offline
  • Profile

Re: Memory leakage issue in IE

Post Posted: Fri Aug 10, 2012 12:41 am
+0-
Ok, thanks for your response. It was helpful. :)
  [ 7 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum