phetsims / forces-and-motion-basics

"Forces and Motion: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/forces-and-motion-basics
GNU General Public License v3.0
7 stars 10 forks source link

memory leak detected #277

Closed jessegreenberg closed 5 years ago

jessegreenberg commented 5 years ago

Starting yesterday, CT started to detect a consistent memory leak

forces-and-motion-basics : phet-io-fuzz : require.js : run
Query: brand=phet-io&phetioStandalone&ea&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed
Error: Assertion failed
    at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/assert/js/assert.js:22:13)
    at updateAppliedForcePosition (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/forces-and-motion-basics/js/motion/view/PusherNode.js?bust=1548202228262:206:17)
    at Array.<anonymous> (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/forces-and-motion-basics/js/motion/view/PusherNode.js?bust=1548202228262:282:9)
    at Emitter.emit3 (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/axon/js/Emitter.js?bust=1548202228262:303:54)
    at NumberProperty._notifyListeners (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/axon/js/Property.js?bust=1548202228262:239:27)
    at NumberProperty.setValueAndNotifyListeners (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/axon/js/Property.js?bust=1548202228262:219:12)
    at NumberProperty.set (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/axon/js/Property.js?bust=1548202228262:152:14)
    at NumberProperty.set (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/axon/js/NumberProperty.js?bust=1548202228262:84:13)
    at NumberProperty.set value [as value] (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/axon/js/Property.js?bust=1548202228262:308:34)
    at Emitter.<anonymous> (https://bayes.colorado.edu/continuous-testing/snapshot-1548200844544/scenery-phet/js/FineCoarseSpinner.js?bust=1548202228262:62:29)
id: Bayes Chrome

Reports started at 6:47 PM 1/22/19.

jessegreenberg commented 5 years ago

Taken over about 3 minutes of fuzz testing: image

I am not seeing much of a leak, but these heap sizes are much larger than I usually see.

jessegreenberg commented 5 years ago

Continuing to run, heap size is up to 92 MB.

jessegreenberg commented 5 years ago

Doing other things and refreshed the sim in another window. Now heap sizes are down by about half. In the original test I see two entries called "WeakMap" and "Detached Window" that are taking up a large amount of memory. image

These don't exist in my later tests. What are these?

jessegreenberg commented 5 years ago

I refreshed and these things came back, with a much larger heap size.

jessegreenberg commented 5 years ago

Now I can't get these to show up at all. Very weird. And, I realized that I missread the error

Uncaught Error: Assertion failed

Caught during memory test fuzzing, but error has nothing to do with memory. I think this has been fixed. And since I am not seeing the WeakMap or the large memory usage anymore locally I don't know what to do about that. If this error disapears on CT ill just close.

jessegreenberg commented 5 years ago

OK, this seems fixed in latest iteration of CT. CLosing.