phetsims / fractions-common

Common code for Fractions simulations
MIT License
0 stars 1 forks source link

Memory Leak testing #39

Closed Denz1994 closed 5 years ago

Denz1994 commented 5 years ago

Reported during #29.

Does a heap comparison using Chrome Developer Tools indicate a memory leak?

Testing on macOS (10.13.6) + Chrome (71.0.3578.98) + incognito mode. Heap comparison shot in 15 minute intervals below.

Fractions intro: image

Denz1994 commented 5 years ago

Fractions - Equality image

Denz1994 commented 5 years ago

Build-A-Fraction: ]image

Denz1994 commented 5 years ago

Fractions-Mixed-Numbers: image

Denz1994 commented 5 years ago

Based on my experience doing previous memory test, I would have expected memory usage to plateau after 2hrs. But results seem inconsistant especially in Fractions-Mixed-Numbers and Build-A-Fraction.

There are some spikes in memory usage, and I believe those snapshots were taken when the sim was on a lab screen. I will do a long test at 30 min intervals and if the inconsitancy persist, commence memory leak testing on only the lab screens in the related sims.

Denz1994 commented 5 years ago

Testing on macOS (10.13.6) + Chrome (71.0.3578.98) + incognito mode. Heap comparison shot in 30 minute intervals below.

Note: Snapshot 13 to Snapshot 14 was taken with about an hour interval.

Denz1994 commented 5 years ago

Fractions Intro: image

Denz1994 commented 5 years ago

Fractions - Equality image

Denz1994 commented 5 years ago

Build-A-Fraction: image

Denz1994 commented 5 years ago

Fractions-Mixed-Numbers: image

Denz1994 commented 5 years ago

Based on the latest test this is looking like a slow memory leak. Total test time for the second test was roughly 8.5 hours and my browser didn't crash. This may not be specific to the lab screen as previously I thought because Fractions-Equality doesn't have a lab screen. Thoughts on what might be causing this slow leak @jonathanolson.

During code review (#29), there were some added REVIEW comments regarding dispose calls and unlinks to properties. Perhaps addressing these comments and commencing another memory test would be a good starting point. Turning over to @jonathanolson for added input and follow up.

jonathanolson commented 5 years ago

Verified after 12 hours that there is no significant memory leak now. Closing.