473,757 Members | 8,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE 7 memory leak when you remove an element from page, or Drip bug?

Hi.
I have a <tdelement, with <ain it and <spaninside <a>, all
created statically (e.g. poresent in HTML when the page loads).
Later I execute the code that adds reference to td in question to a JS
object.
Then, when I remove TD from DOM tree, I set js object field to null.
When the page is unloaded the td leaks.

I tried all kinds of tircks but to no avail; what's more interesting
is that if you detach A from TD they both leak while A was never
referenced from anywhere in the first place!
THen, if you do not remove the TD from DOM tree and do everything else
the same way it doesn't leak too.
Currently I resorted to creating an invisible garbage div and moving
it there - it gets collected this way.

Could there be a bug w/ Drip showing that TD and A leaks?
Or if it's not a bug in Drip, why does it leak? Drip reference count
shows 5 for both TD and A; who the hell references them 5 times? 0_o

Oct 24 '07 #1
4 1901
Please don't multi-post. http://en.wikipedia.org/wiki/Usenet

Sergei Shelukhin wrote:
I have a <tdelement, with <ain it and <spaninside <a>,
Read like bad style.
all created statically (e.g. poresent in HTML when the page loads).
Later I execute the code that adds reference to td in question to
a JS object.
Which code?
Then, when I remove TD from DOM tree, I set js object field to null.
When the page is unloaded the td leaks.
Meaning what?
[...]
Could there be a bug w/ Drip showing that TD and A leaks?
Who knows. What is Drip?

http://jibbering.com/faq/
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Oct 24 '07 #2
On Oct 24, 8:59 am, Sergei Shelukhin <realg...@gmail .comwrote:
Hi.
I have a <tdelement, with <ain it and <spaninside <a>, all
created statically (e.g. poresent in HTML when the page loads).
Later I execute the code that adds reference to td in question to a JS
object.
Then, when I remove TD from DOM tree, I set js object field to null.
When the page is unloaded the td leaks.
Post a sample.
>
I tried all kinds of tircks but to no avail; what's more interesting
is that if you detach A from TD they both leak while A was never
referenced from anywhere in the first place!
Post a sample.
THen, if you do not remove the TD from DOM tree and do everything else
the same way it doesn't leak too.
Post a sample.
Currently I resorted to creating an invisible garbage div and moving
it there - it gets collected this way.
Don't post that.
>
Could there be a bug w/ Drip showing that TD and A leaks?
Yes. Drip is a derelict product with known issues.

Oct 24 '07 #3
Hmm, [0]s are indeed required, I wonder why it didn't cause any
problems yet, thanks for noting it.
It is hard to say without seeing the rest of this object, but I assume
it binds event handlers to the item elements at some point. You
likely need to set the event handler properties (e.g. onclick,
onmouseover) to null.
We use ASP.NET AJAX handlers and launch $clearHandlers on each object
when it's removed and then on all the remainng objects on unload.
If you remove the handlers completely, tho, td & a still leak.

Oct 25 '07 #4
On Oct 25, 3:54 am, Sergei Shelukhin <realg...@gmail .comwrote:
Hmm, [0]s are indeed required, I wonder why it didn't cause any
problems yet, thanks for noting it.
It is hard to say without seeing the rest of this object, but I assume
it binds event handlers to the item elements at some point. You
likely need to set the event handler properties (e.g. onclick,
onmouseover) to null.

We use ASP.NET AJAX handlers and launch $clearHandlers on each object
Not from the looks of this code:

item.element.pa rentNode.remove Child(item.elem ent);
item.element = null;
when it's removed and then on all the remainng objects on unload.
If you remove the handlers completely, tho, td & a still leak.
According to Drip anyway. If you post a working example, perhaps I
can tell you if Drip is lying or not.
Oct 25 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3648
by: Elbert Lev | last post by:
#When I'm running this script on my windows NT4.0 box, #every time dialog box is reopened there is memory growth 384K. #Bellow is the text I sent to Stephen Ferg (author of easygui) # I have tested the pure Tkinter, # by modifiing on of the examples in the distribution. # This little guy also exibits the same behaviour. # Namely: every time the window is closed and reoppend, # there is memory leak of several hundreds 384K
7
1585
by: Jon Davis | last post by:
OK I have a web app that I built that makes MANY calls to the DB in each request. The app wasn't tuned for scalability so this wasn't a problem, but time is too short to redesign how the database is accessed because the data that's being stored is time relevant and the web app will be thrown out in a few months. Since I try to separate the OleDb stuff from the business logic, I just create new database connections and trust that those...
8
8552
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of each object within my JS app to help locate my problem? Thanks
2
2371
by: Robert | last post by:
Hello javascript group readers, I have a question regarding how to prevent memory leaks in Internet Explorer when using closures. I already knew about the circular reference problem, and until now was able to prevent memory leak problems. But I needed to store DOM elements and can't solve it anymore. So I search the group archive to see if I missed any valuable information. I found some interesting articles, but somehow could not apply...
6
3631
by: Andrew Poulos | last post by:
If I code something like the following it results in a memory leak in IE (as Leak 0.5 tells me): var frm = document.createElement("FORM"); document.body.appendChild(frm); fDeleteForm = function() { document.body.removeChild(frm); };
9
3380
by: Joshua | last post by:
I posted this originally in the csharp group, but I think that may be the wrong group. This seems more appropriate: I'm running into an issue with a memory leak in an Asp.Net web page. In the code behind (.cs) I'm adding onchange, onblur and onfocus events to a bunch of objects that reside on my page (textboxes and dropdownlist). After using Drip i've found that these are leaving open DOM objects.
3
1358
truefontfamily
by: truefontfamily | last post by:
<html> <head> <script type="text/javascript"> function appendRemoveTest() { var obj = document.createElement( 'DIV' ); document.body.appendChild( obj ); document.body.removeChild( obj ); obj.removeNode( true ); obj = null;
11
4236
by: dhtml | last post by:
(originally mis-posted on m.p.s.jscript...) I've just closed all windows in Firefox and its using 244MB of memory. I have no idea why. I had GMail open, a page from unicode, the CLJ FAQ. I've noticed that createElement leaks. It's obvious with form controls because the form keeps the control name as a property. Example:
0
9489
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10072
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9737
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.