Opened 9 years ago
Closed 9 years ago
#15235 closed bug (migrated)
.css('marginRight') - memory leak
Reported by: | flexphperia | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | None |
Component: | css | Version: | 2.1.1 |
Keywords: | memory leak, reliableMarginRight | Cc: | |
Blocked by: | Blocking: |
Description
I have found memory leak in reliableMarginRight function.
Memory leak is created when you call $element.css('marginRight')
JsFiddle: http://fiddle.jshell.net/z3jo9k1q/show/light/
Test case:
- open above address in Chrome,
- open developer tools, make Heap snapshot,
- click on button in jsfiddle example, red element will be removed
- make another heap snapshot with browser tools
- compare snapshots, you will find one HtmlDivElement that is detached from DOM but keeping reference in reliableMarginRight function
Fix: Adding this, after 5665 line in jQuery uncompressed code will fix the problem:
docElem.removeChild( container ); div.removeChild( marginDiv ); //this is new line
Change History (3)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Status: | new → open |
---|
comment:3 Changed 9 years ago by
Resolution: | → migrated |
---|---|
Status: | open → closed |
Migrated to https://github.com/jquery/jquery/issues/1795
Note: See
TracTickets for help on using
tickets.
Here's direct link to jsFiddle : http://fiddle.jshell.net/z3jo9k1q/
Click RUN before testing for memory leaks in Chrome.
Is there any chances to fix this bugi in next release? It's quite important.