phetsims / fluid-pressure-and-flow

"Fluid Pressure and Flow" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
8 stars 5 forks source link

Test for memory leaks #308

Open zepumph opened 7 years ago

zepumph commented 7 years ago

This slack conversation will help guide me for this issue:

Michael Kauzmann [10:55 AM] From the code review:

Does a heap comparison using Chrome Developer Tools indicate a memory leak? (Describing this process is beyond the scope of this document.)

Where is the document that contains that scope?

[10:56] Should there be one?

[10:56] I feel like I have spent a lot of other devs' time trying to learn how to test for memory leaks well.

[10:57] Perhaps consolidating everyone's insights would be good to the team. (edited)

Denzell Barnett [10:59 AM] I referenced feeds outside of PhET docs to learn about testing for memory leaks. I have this one bookmarked. I don’t know if that helps you much though. https://developers.google.com/web/tools/chrome-devtools/memory-problems/memory-101 Google Developers Memory Terminology | Web | Google Developers This section describes common terms used in memory analysis, and is applicable to a variety of memory profiling tools for different languages.

Chris Malley [11:31 AM] There is no document that describes how to test for memory leaks. I typically document the results of such testing in a GitHub issue. So you might want to refer to one of those issues to get a feel for the general approach. For example, https://github.com/phetsims/molecule-polarity/issues/33 GitHub test for memory leaks · Issue #33 · phetsims/molecule-polarity Test for memory leaks by running with ?ea&brand=phet&realMolecules&fuzzMouse and comparing heap snapshots. Note that this will test with the partially-implemented Real Molecules screen (sans 3D vie...

[11:35] You start by comparing heap snapshots. How you proceed from there depends on what the comparisons reveal. I don’t think it’s practical for PhET to create a document that describe how to troubleshoot memory issues. It’s probably also not necessary, since (as Denzell noted above) Google provides documentation. (edited)