Skip to main content

Bug Tracker

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:

I have found memory leak in reliableMarginRight function.

Memory leak is created when you call '''$element.css('marginRight')


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


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 flexphperia comment:1

Here's direct link to jsFiddle :

Click RUN before testing for memory leaks in Chrome.

Is there any chances to fix this bugi in next release? It's quite important.

Changed October 16, 2014 07:42PM UTC by dmethvin comment:2

status: newopen

Changed October 21, 2014 12:59AM UTC by m_gol comment:3

resolution: → migrated
status: openclosed