Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13065 closed defect (fixed)

[regression] dojo.destroy() leaks memory on IE6

Reported by: bill Owned by: Kris Zyp
Priority: high Milestone: 1.7
Component: Events Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

See attached test case, the jist of which is:

for (var i = 0; i < 10000; ++i) {
	var node = dojo.create("span", {innerHTML: i}, target);
	dojo.connect(node, "onclick", function(){console.log("onclick"); });
	dojo.destroy(node);
}

On 1.6 iexplorer.exe VM size increases by 8M. On trunk it increases by 140M.

History: #1727 added special code for destroying nodes on IE. #2931 ported that from 0.4 to 1.0. [24471] removed that code. I suspect that's the problem, although it could be something from the new event code too.

Attachments (1)

destroyLeak.html (626 bytes) - added by bill 8 years ago.
test case

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by bill

Attachment: destroyLeak.html added

test case

comment:1 Changed 8 years ago by Kris Zyp

(In [25179]) Revert dojo.destroy changes, hopefully fix memory leak, refs #13065 !strict

comment:2 Changed 8 years ago by bill

That brings it down to a 44M increase. Better than before, although still worse than 1.6. Also, you didn't add back in the addOnUnload() section to destroy that helper div.

comment:3 Changed 8 years ago by Douglas Hays

Refs #13072

comment:4 Changed 8 years ago by Kris Zyp

(In [25191]) Revert rest of dojo.destroy changes, hopefully fix memory leak, refs #13065, fixes #13072 !strict

comment:5 Changed 8 years ago by bill

(In [25195]) Put back unload require, it's needed again. Refs #13065, #13072, #12672, #12790 !strict.

comment:6 Changed 8 years ago by bill

Re [25191], unfortunately it's still leaking about 50M. The addOnWindowUnload() call doesn't have any effect until you unload the web page, but this bug is about dynamically creating/destroying nodes without unloading the page.

comment:7 Changed 8 years ago by Kris Zyp

(In [25203]) Use on(window, "unload", to monitor for unload, refs #13065 !strict

comment:8 Changed 8 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

(In [25208]) Reduce closure on listener fix function, fixes #13065 !strict

comment:9 Changed 8 years ago by bill

Thanks, that brings it back (more or less) to the 1.6 performance.

Note: See TracTickets for help on using tickets.