phetsims / masses-and-springs-basics

"Masses and Springs: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 3 forks source link

Memory Leak Testing #50

Closed Denz1994 closed 5 years ago

Denz1994 commented 5 years ago

Opening for #48.

Memory leak testing should be tracked and documented here. I will start a test and have the reviewer of #48 confirm memory leaks aren't present.

I expect results to be similar to https://github.com/phetsims/masses-and-springs/issues/339.

Denz1994 commented 5 years ago

Testing on Windows 10 Chrome ( Version 71.0.3578.98 ) Incognito mode. Snapshots were taken with 15-20 intervals.

image

Denz1994 commented 5 years ago

I will run another test on iOS to be thorough.

Denz1994 commented 5 years ago

Testing on iOS (10.13.6) Chrome (71.0.3578.98) Incognito mode with 15-20 minute intervals between snapshots.

image

Denz1994 commented 5 years ago

In a zoom discussion with @jonathanolson it was explained that there is a better process for memory leak testing.

Process:

  1. fuzz a built version of the sim with grunt --minify.mangle=false
  2. allow sim to run for a bit
  3. run phet.chipper.queryParameters.fuzz=false in console to pause sim
  4. on each screen press resetAllButton (or setup sim in specific reproducible state)
  5. take heap snapshot
  6. run phet.chipper.queryParameters.fuzz=true in console to unpause sim
  7. repeat steps 2-7 for desired time

This process is definitely more consistant and saves time. Previously runs would be extended due to variability in object creation at the time of the heap snapshot. Steps 3-6 ensures we are always using a specific state after the sim has been running for a while and testing against that same state.

I'll rerun the test and post results here.

Denz1994 commented 5 years ago

Testing on iOS (10.13.6) Chrome (71.0.3578.98) Incognito mode with 30 minute intervals between snapshots.

image

The results are similar as above. There isn't anything here that stands out as a memory leak. Closing this issue. Thanks @jonathanolson for the input.