Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

JQuery Mobile Memory Leak while transitioning from one page to another #6895

Closed
wauwau0977 opened this issue Jan 7, 2014 · 0 comments
Closed

Comments

@wauwau0977
Copy link

Hi

I submitted a bug report earlier (issue 6816), which was rejected due to missing JsBin. Here one example with a JsBin.

Issue description When navigating between pages with JQM a memory leak occours.

Test page Go to http://jsbin.com/UqaGuMu/4

Steps to reproduce a) Bring up the test page. Go to page 1 click on link to go to page page 2. Go back to page 1. b) Open Google Chrome Dev Tools and take a heap snapshot. c) Now repeat going from page 1 to page 2 about 10x. d) Take another heap snapshot. e) Compare heap snapshot 1 with 2. You will see a difference of about 100k. See the screenshot attached.

Expected outcome I expect the memory to be constant after i visited every page at least one. In a real world app, the leak may be much bigger depending on the complexity of the page. The memory grows and leads to a resource shortage which may cause several problems.

Actual outcome The memory increases. 10x switching between page1 and page2 increases the memory of about 100k. See screenshot attached!

Platforms/browsers (including version) and devices tested Latest Google chrome browser. Seen on real android 4.2 devices where page got slower over time of usage.

jQuery Mobile and jQuery core version used JQM 1.4.0 release. JQuery 1.9... The leak also shows with JQuery version 2.x.

Other relevant information, e.g. using PhoneGap No phonegap.

Thanks for looking at this. In a real world app that is really an issue since the detached DOM may be much bigger. Further in a real world app there are even more reasons for leaks (usually closures of widgets).

I learnt, that a JsBin is required for a correct bug submission. I think this could be a risk when dealing with memory leaks, since every additional framework/component may cause the leak itself. I tested that with a plain standalone version too, so we can be sure, it's not realated to JsBin in that case.

Cheers,
Patrick Heusser

memory_leak_analysis_googleprofiler

arschmitz added a commit that referenced this issue Jan 22, 2014
Also no its own module including support tests for animations and
transitions

Fixes gh-5156
Fixes gh-6816
Fixes gh-6697
Fixes gh-6895
Fixes gh-6148
arschmitz added a commit that referenced this issue Feb 12, 2014
Also no its own module including support tests for animations and
transitions

Fixes gh-5156
Fixes gh-6816
Fixes gh-6697
Fixes gh-6895
Fixes gh-6148
Closes gh-7001
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant