-
Notifications
You must be signed in to change notification settings - Fork 12
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 leaks in Dialog #432
Comments
@samreid and @pixelzoom please discuss and collaborate on improving dialog. We are adding dialogs in several sims with increased functionality so now would be a good time to improve the implementation. How about come up with a plan and lets discuss a developer meeting, and we can prioritize further there. |
Also |
@samreid and I discussed the general status of Dialog today via Skype. But we have no plan yet for how to move forward. The first order of business would likely be to triage related issues, evaluate the current implementation, then decide whether to revised the currently implementation or start over. |
And we should probably create a new issue titled something like "improve Dialog", since this issue is not appropriate for the task that @ariel-phet specified in https://github.com/phetsims/joist/issues/357#issuecomment-248452092. |
9/22/16 dev meeting: I'll create an "improve Dialog" issue, link to related issues, look for design meeting plans, etc. |
Unassigning, now tracking in the more general issue https://github.com/phetsims/joist/issues/359 ("improve Dialog"). |
Still an issue in Dialog. Should be addressed when Dialog is revised/rewritten in #359. |
Yet another leak, discovered in phetsims/molecule-polarity#33. Dialog doesn't own the |
3/29/18 dev meeting: @andrea-phet and I will triage this issue. |
Dialog has been moved to sun. So I'm going to move this issue from joist to sun using GitHub's new "Transfer issue" feature. |
Memory leaks in dialogs appears to be the main cause of the issue reported for blackbody-spectrum in phetsims/blackbody-spectrum#72. Here are a couple of screenshot from the memory profile comparison: I put a Labeling for dev meeting to see if we can assign someone to follow up on this. It's not a huge memory leak, but we should fix it so that developers aren't spending time tracking this down for every sim that they publish. |
@jbphet I don't see any sim-specific Dialogs in blackbody-spectrum, so I'm guessing that the Dialogs that you're referring to in the previous comment are exclusively from the PhET menu. If that's the case, then this is not specific to blackbody-spectrum and is impacting all sims. |
@ariel-phet this issue is still assigned to @andrealin. Should it be reassigned? |
In phetsims/joist#424 Dialogs from the PhET menu were made to exist for the life of the sim which is why if ( !updateDialog ) {
var phetButton = sim.navigationBar.phetButton;
updateDialog = new UpdateDialog( phetButton );
}
updateDialog.show(); |
Hmmm... If PhET menu dialogs are persistent, then I wonder which dialogs @jbphet is referring to in blackbody-spectrum. #432 (comment) seems to indicate UpdateDialog. |
2/21/19 dev meeting:
|
I tested this using the "Blast" example sim, since it has very little going on that would cause memory to be allocated. I'll add details below, but my conclusion is that the dialogs are not leaking memory, they just take a while to allocate all that they use. This was done on master as of today. Below is a screenshot of the rate of leakage on blast. There does seem to be a slow leak during fuzz testing, but when I compared the memory snapshots and spot checked a number of the additional allocations, they all seemed to be associated with Scenery pools. The screenshot shows memory values at 0-5 min of fuzz test sampling at every minute, and then one last snapshot after stopping the test. I ran a second test where I started the sim, brought up the dialogs that are available from the PhET menu, recorded and snapshot, brought up the dialogs again, and recorded another snapshot. Again, there was some memory allocated, but it all seemed traceable to Scenery pools. I'm not sure where to go next with this, so I'll mark for dev meeting and we can collectively decide. |
Potential memory leak for @jbphet said:
I reviewed Dialog and I don't see any of the potential leak sources that existed when this issue created. And since all of our dialogs are currently persistent, I don't know how they could leak. So I think we can close this issue...
... and create an issue for the potential leak in Scenery pools. |
I'm not opposed to further investigation, but the pattern we have seen previously in sims like graphing lines is that it takes 30+ minutes for our memory patterns to stabilize: phetsims/graphing-lines#78 (comment). So I'm not convinced that the data in #432 (comment) indicates a leak. Happy to be proved otherwise, though! |
An idea of another test, manually set the Poolable option this will be investigated in phetsims/phet-core#55. There seems to be no memory leak in Dialog. As of dev meeting today, closing |
Multiple leaks in joist.Dialog:
Dialog doesn't own any of these things that it's adding listeners to;
content
is a constructor argument, andtitleNode
is an alias foroptions.title
. Dialog also has nodispose
function to remove the listeners, so it would technically fail a code review.Assigning to @ariel-phet to prioritize and assign.
The text was updated successfully, but these errors were encountered: