Bug Tracker

Modify

Ticket #9471 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

memory leak noticed when loading jquey.1.6.1.min.js included html pages in the iframe

Reported by: r_ramasamy@… Owned by: rwaldron
Priority: high Milestone: 1.6.2
Component: core Version: 1.6.1
Keywords: Cc:
Blocking: Blocked by:

Description

I have test-iframe.html that has link to test-page1.html and test-page2.html. Test pages includes jquery.1.6.1.min.js. The html files are shown below. when tried for every load, I can see 800kb to 1MB memory leak that keeps adding up and memory usage is constantly growing. IE7 and IE8 were used to test this.

test-iframe.html

<html> <body>

<iframe src="/test-page1.htm" width="100%" height="300">

<p>Your browser does not support iframes.</p>

</iframe>

</body> </html>

test-page1.html

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Select work</title> <script type="text/javascript" src="jquery-1.6.1.min.js"></script> </head>

<body style="overflow:hidden;margin: 0px; padding: 0px;" > <br/> <br/> <br/> <br/> <br/> <a href="test-page2.htm">page2</a> </body> </html>

test-page2.html

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Select work</title> <script type="text/javascript" src="jquery-1.6.1.min.js"></script> </head>

<body style="overflow:hidden;margin: 0px; padding: 0px;" > <br/> <br/> <br/> <br/> <br/> <a href="test-page1.htm"> page1 </a> </body> </html>

Change History

comment:1 Changed 3 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to core

comment:2 Changed 3 years ago by rwaldron

Duplicate of #4693.

comment:3 Changed 3 years ago by rwaldron

  • Status changed from closed to reopened
  • Resolution duplicate deleted

comment:4 follow-up: ↓ 5 Changed 3 years ago by rwaldron

  • Owner set to rwaldron
  • Priority changed from low to high
  • Status changed from reopened to assigned

I've noticed a swell in memory leak tickets all related to the same issue so I decided to give this a deeper more thorough look. I rebuilt the test case and ran it through sIEve and I can confirm the leak when using iframes. Every time an iframe is loaded with jQuery, more orphaned elements are introduced by the support module.

Nulling all of the references in support caps the memory leak. The only way I was able to confirm this was by running sIEve again and observing that no unexpected orphan elements were being reported.

 https://github.com/jquery/jquery/pull/401

comment:5 in reply to: ↑ 4 Changed 3 years ago by r_ramasamy@…

Before entering the ticket, I did use the SIEve and confirmed the memory leak.

Replying to rwaldron:

I've noticed a swell in memory leak tickets all related to the same issue so I decided to give this a deeper more thorough look. I rebuilt the test case and ran it through sIEve and I can confirm the leak when using iframes. Every time an iframe is loaded with jQuery, more orphaned elements are introduced by the support module.

Nulling all of the references in support caps the memory leak. The only way I was able to confirm this was by running sIEve again and observing that no unexpected orphan elements were being reported.

 https://github.com/jquery/jquery/pull/401

comment:6 Changed 3 years ago by rwaldron

Well, awesome! (it wasnt mentioned, but no big deal)

comment:7 Changed 3 years ago by rwldrn

  • Status changed from assigned to closed
  • Resolution set to fixed

Landing pull request 401. Nulling all elements created in support.js; Fixes #9471.

More Details:

comment:8 Changed 3 years ago by timmywil

  • Milestone changed from 1.next to 1.6.2

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.