Closed zepumph closed 1 year ago
I noticed that there are 38000 TinyOverrideProperties created after cycling through every single locale in the preferences menu (they are created lazily per locale). That only got me up to 84MB though, which includes creating the preferences dialog.
Geometric optics phet-io brand is 90MB when you start the sim, and the open the about, keyboard, and preferences dialog. That is the best benchmark for memory testing I believe.
load GO with phet-io brand: 67. add preferences: 74 add keyboard help: 88MB add about: 89.8MB
I believe this has to do greatly with my decision in https://github.com/phetsims/joist/issues/874 because we are creating a new instance of the keyboard dialog per screen. In most cases this isn't necessary. Before we were just reusing the dialog for each in those cases. Hmmm. I think we can save at least 7mb on the creation of the help dialog. I'll take a look.
I feel we have had several recent RCs with no memory leaks. @zepumph can this issue be closed?
Oops wrong issue number on those commits, I'll comment in the commit threads.
I believe you are correct. At one point I felt like it may be worth some time trying to hunt down smaller memory leaks that may be causing undo trouble in certain, uncommon cases, but that is most likely not worth the time at all. We should wait to find them during memory testing. Ready to close.
Related to https://github.com/phetsims/joist/issues/889, https://github.com/phetsims/scenery/issues/1494 and https://github.com/phetsims/scenery-phet/issues/769, and also https://github.com/phetsims/geometric-optics/issues/373. There seems to be some real problems with memory recently. Geometric optics can easily get from a starting heap of 67MB to 127 after a few minutes of fuzzing in phet-io brand.