Solved

Memory leaks with IE6 + Jquery 1.4.2 + JqueryUI 1.8.1

Posted on 2011-03-24
5
338 Views
Last Modified: 2012-08-14
Dear Experts,

It seems we hit huge memory leaks with our web application, one request may cost 1-2M memory.

1.analysis with IEJSLeaksDetetor
 IEJSLeaksDetetor a.Refer to the document tree, it seems the JS files had been load repeatedly?

2.analysis with sIEve
 sIEve -memory usage sIEve 2
any suggestion?
thank you very much.
0
Comment
Question by:whbcn
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:darren-w-
ID: 35206006
Hi,

You may have a infinite loop, need to analyse the source and isolate sections of it to identify what is causing the problem?

Darren
0
 

Author Comment

by:whbcn
ID: 35212791
I update the JqueryUI with the latest version(1.5.1 + 1.8.11), and use IEJSLeaksDetetor to analysis again, it seems every Dom with event caused memory leaks.

The IEJSLeaksDetetor  show most memory leaks caused by below code:

elem.attachEvent( "on" + type, eventHandle )
Jquery.js
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
                              // Bind the global event handler to the element
                              if ( elem.addEventListener ) {
                                    elem.addEventListener( type, eventHandle, false );

                              } else if ( elem.attachEvent ) {
                                    elem.attachEvent( "on" + type, eventHandle );
                              }
                        }
0
 

Author Comment

by:whbcn
ID: 35213089
We just using Jquery in the very simple way. Mostly like :

$("#DB_editCollInfoBtn").click(function(){
   ......
}

We have not found a infinite loop yet.
Any other idea?  It seems that the events have not been unbind or removed.
0
 
LVL 13

Accepted Solution

by:
darren-w- earned 250 total points
ID: 35213575
Try running $("#DB_editCollInfoBtn") in a console (firebug/Chrome element inspector) and see what it brings back, in theory if its a id there should be only one item of this type, is this the case?

if not the id should be changed to a class and then look to using an each method to go through the items.

Another thing to look at is if the page is valid using this validator http://validator.w3.org/, copy the displayed source into it, as if this could be causing problems too...

Also validate the css using the css validator of the same site.

Darren
0
 

Author Comment

by:whbcn
ID: 35229785
In Chrome, it shows as below:
---------------------------------------------------------
top.right.document.getElementById("back")
HTMLButtonElement
----------------------------------------------------------
The application uses frame tag for a layout. the frame parts in "menu domain" and "the contents domain". even I just click the menu n "menu domain"(Response to "the contents domain"), the sIEve show leaks.
So is it some issue about the frame?
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 50
designing in object programming 12 78
how can i Return this word's max repeat count? 2 18
jqury 17 30
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question