Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#6944 closed bug (invalid)

Mobile Safari memory leak with $("img").remove()

Reported by: musicisair Owned by:
Priority: undecided Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: iPad, mobile safari, memory leak Cc:
Blocked by: Blocking:

Description

Related: http://stackoverflow.com/questions/2986039/ipad-iphone-browser-crashing-when-loading-images-in-javascript

I dont' have an iPad to test on so I can't create a test page, sorry.

However, it looks as though iPad's Safari does NOT deallocate memory for images that are removed from the DOM. An answer in the StackOverflow link above mentions that assigning a dataURI with an encoded 1x1 px gif as the "src" of the image should help safari deallocate the memory used for that image element.

Change History (3)

comment:1 Changed 13 years ago by addyosmani

Priority: undecided
Resolution: invalid
Status: newclosed

I've tested and confirmed that this is an issue with Mobile Safari itself and not actually a problem due to jQuery (or specifically $('img').remove()).

Mobile Safari generally has issues with JavaScript memory allocation which are down to the limits and actual implementation Apple have applied to that version of their browser.

If you read through the StackOverflow thread you will see that there are a few different solutions presented there that successfully allow you to workaround the JS memory allocation issue without any trouble.

Closing ticket.

comment:2 Changed 12 years ago by anonymous

So we still don't have a solution to this problem?

comment:3 Changed 12 years ago by musicisair

I thought that last iOS 4.1 update fixed it. Hm. guess not?

Note: See TracTickets for help on using tickets.