-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Leak #259
Comments
Memory testing for the 1.0 release was done by me in #130, and by @KatieWoe in phetsims/qa#711 (comment). There were no memory leaks at that time. Because this sim has been converted to support dynamic locale, the most likely culprit for leaks is a link to a LocalizedStringProperty that has not been cleaned up. That is most typically a Text or RichText that needs to be disposed, but could be an explicit link, Multilink, or DerivedProperty. Unfortunately, the |
There is definitely a leak in TickLabelSet, tracking in phetsims/bamboo#64. |
Because the Text
RichText
DerivedStringProperty
PatternStringProperty
|
To check where this is at, I tested with https://phet-dev.colorado.edu/html/fourier-making-waves/1.1.0-dev.7/phet/fourier-making-waves_all_phet.html?fuzz. Snapshots 1-10 are at 1-minute intervals. Snapshot 11 is 10 minutes after Snapshot 10. No improvement at all here. In fact, this is much worse than what @KatieWoe reported. Either I did something to make it worse, or I picked up something from common code before I published /1.1.0-dev.7. Ugh. Heap comparisons unfortunately did not tell me anything, because I forgot to build with ![]() |
https://phet-dev.colorado.edu/html/fourier-making-waves/1.1.0-dev.8/phet/fourier-making-waves_all_phet.html?fuzz was built with ![]() I tried comparing Snapshots 6 & 7, because there was a big increase there. But I could not grok the comparison. Sorting by "# Delta", the top 10 are all very obfuscated, nothing that I recognize: ![]() |
@jbphet and I looked at this, and he gave me a couple of good ideas for what state the sim should be in when taking heap snapshots. Basically:
I'll probably do further debugging in the unbuilt version, because we saw fewer mangled names there. I'm also going to test with |
Running unbuilt in my local copy, http://localhost:8080/fourier-making-waves/fourier-making-waves_en.html?brand=phet&ea&debugger&fuzz, I am no longer seeing a memory leak. See snapshots below. Snapshots 1-10 are at 1-minute intervals. Snapshot 11 is 10 minutes after Snapshot 10. So heap size stabilizes at ~185 MB, and is still in that range after 20 minutes of fuzzing. This test was done after fixing memory leaks for TickLabelSet over in phetsims/bamboo#64. I also made a simplification to how TickLabelSet removes unused labels from its cache, and that simplification involved removing a ![]() |
I backed out the memory leak fixes for TickLabelSet, then compared heap snaphots at startup and 20 minutes of fuzzing. See below. The memory leak did not return, and after 20 minutes of fuzzing, it's still in the ~185MB ballpark -- consistent with the test in #259 (comment). So TickLabelSet was not the culprit. Perhaps something got fixed in common code since the tests that I did yesterday? I'll ask in Slack#developer. ![]() |
No one reported any common-code fixes in Slack#developer, but @jessegreenberg replied:
Unfortunately, this issue has not been specific about Chrome version. As noted above, 1.1.0-dev.5 through 1.1.0-dev.8 were all leaking badly. So I retested 1.1.0-dev.7, noting that I'm using Chrome Version 131.0.6778.109 on macOS 15.1.1. After 30 minutes of fuzzing, the heap size grew to ~500MB. So it's not a problem with Chrome. |
https://phet-dev.colorado.edu/html/fourier-making-waves/1.1.0-dev.9/phet/fourier-making-waves_all_phet.html?fuzz was built with ![]() |
Revisiting 1.1.0-dev.8, I used the test protocol that @jbphet suggested in #259 (comment). Digging down into the ![]() |
I've tested this so many times that I'm not going to ask @KatieWoe to test again, and I'll simply close the issue. We'll be doing another memory test in RC, and that should suffice. |
Actually... I leave this open, to be verified in 1.1.0-rc.1. |
Please do a memory test for phetsims/qa#1186. If it looks OK, you can close this issue. |
For phetsims/qa#1178. Seen on Win 11 Chrome. First screenshot taken at start, and subsequent screenshots taken one minute apart during fuzzing.
![memleak](https://private-user-images.githubusercontent.com/41024075/392123084-776f2af9-48c2-4296-afee-13b8b5a53308.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MzczODgsIm5iZiI6MTczOTYzNzA4OCwicGF0aCI6Ii80MTAyNDA3NS8zOTIxMjMwODQtNzc2ZjJhZjktNDhjMi00Mjk2LWFmZWUtMTNiOGI1YTUzMzA4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE2MzEyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM5YWI1NzA5YmMzODA2ODNlZjFjYTk0YjNkZTUzMDA5MmM1NTRhY2I3NTEyNGFkYTRiNDYxNDkwZjg5M2QwNzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.w3_h1VnGY_QQNsBa6eFaFdg53x7_kIQ0SmZXMoqoYsE)
There seems to be a noticeable memory leak in the dev test.
The text was updated successfully, but these errors were encountered: