Side navigation
#15235 closed bug (migrated)
Opened September 10, 2014 10:18AM UTC
Closed October 21, 2014 12:59AM UTC
.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')
http://fiddle.jshell.net/z3jo9k1q/show/light/
Test case:
1. open above address in Chrome,
2. open developer tools, make Heap snapshot,
3. click on button in jsfiddle example, red element will be removed
4. make another heap snapshot with browser tools
5. 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
Attachments (0)
Change History (3)
Changed September 20, 2014 10:39AM UTC by comment:1
Changed October 16, 2014 07:42PM UTC by comment:2
status: | new → open |
---|
Changed October 21, 2014 12:59AM UTC by comment:3
resolution: | → migrated |
---|---|
status: | open → closed |
Migrated to https://github.com/jquery/jquery/issues/1795
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.