Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak #2581

Closed
Chromo0511 opened this issue Nov 11, 2018 · 4 comments
Closed

Memory Leak #2581

Chromo0511 opened this issue Nov 11, 2018 · 4 comments
Labels

Comments

@Chromo0511
Copy link

Chromo0511 commented Nov 11, 2018

Environment

Onsen UI Version:

  • 2.10.5
  • 2.10.x

Framework:

  • None

Framework binding:

  • None

Additional libraries:

  • None

Platform:

  • Safari 12.0.1
  • Chrome 70

Encountered problem

Memory leak on the navigator.
When you return to the previous page, a lot of components stay in memory.

How to reproduce

  • Put this html file on your local machine,
  • Do heap snapshot
  • Click on "Push page 2"
  • Click on the "Back button"
  • Do another snapshot
  • Compare the snapshot

You can repeat these operations many time, and the memory usage grow.

page-sample.html

Thanks for you help.

@wcmhc
Copy link

wcmhc commented Nov 12, 2018

I can't seem to reproduce a memory leak with Chrome Version 68.0.3440.106 (Official Build) (64-bit), Chromium V8 6.8.275.26.

profiler image

I used your exact code plus a small script addition to cycle in and out of Page 2 which resulted in a 3MB fluctuation in the heap that was garbage collected fairly regularly with a mass collection near the start of the profiling. The flat line at the end corresponds to Chrome opening the captured profile, hence the large spike in CPU (not sure why that portion is included in the profiling timeline, but it's there). The timeline shows 70 seconds (70000ms on the timeline) of running which means 70 cycles of pushing and popping the navigator. My tests used the heap profiling tool in Chrome.

Extra code:

<script>
setInterval(function() {
	myNavigator.pushPage('page1.html');
	setTimeout(function() {
		myNavigator.popPage();
	}, 500);
}, 1000);
</script>

Note: The 800+ errors are from the navigator being in a transition state when the next popPage() or pushPage(...) is called due to the timers being too short and are thrown by OnsenUI; they are not actual errors. Increase each timer by 2x for reduced errors. I simply want it to be more apparent

Are you able to point me to a specific portion of the heap snapshot, otherwise?

@Chromo0511
Copy link
Author

If you look your JS Heap that grow. Very light because it's a very small content. But if you have a more big content is really more significant.
If you make comparaison between 2 snapshots, you can see a lot of nodes not released.

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Dec 13, 2022
@github-actions
Copy link

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants