-
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
Game screen memory leak #78
Comments
@phet-steele Would you mind running the same test with the published version of Graphing Lines, to verify that this is a new problem? (... which I suspect it is, but want to make sure I'm looking in the right place.) https://phet.colorado.edu/en/simulation/graphing-lines |
@pixelzoom it looks like the current published version (1.1.10) has a memory leak, but not nearly as dramatic: https://phet.colorado.edu/sims/html/graphing-lines/latest/graphing-lines_en.html?screens=4&fuzzMouse
|
Thanks @phet-steele. |
I see zero occurrences on I don't see any cleanup that needs to be handled in graphing-slope-intercept source code, it should all be handled in the code that is reused from graphing-lines. |
…e unlinked when done with a challenge, #78
In the above commit, I added |
… functions for dev button listeners, #78
I addressed the obvious leaks in the above commits. Heap snapshots with
Forcing a garbage collection at 60 minutes, then taking an immediate heap snapshot shows no significant drop in memory. So... Much better, and perhaps acceptable for typical use. But still leaking, and I'm not satisfied yet. |
This sim pre-dates PhET standards for implementation and documentation of |
Heap snapshots with
Forcing a garbage collection at 60 minutes, then taking an immediate heap snapshot shows no significant drop in memory. So... still leaking. |
OK, I think I have the leaks plugged in graphing-lines. Heap snapshots with
|
graphing-slope-intercept also looks good. Heap snapshots with
... I didn't feel the need to test at 60 minutes, because graphing-slope-intercept does no memory allocation of it's own, relies totally on graphing-lines. |
Given the number of files that I had to touch, I felt obliged to test all features of the sim. I didn't notice anything broken, but I've given how much I've been staring at this sim, it's probable that I missed something. @phet-steele feel free to verify my memory tests. And please give take a quick look at the entire sim to see if I missed anything. |
@pixelzoom, a quick look didn't reveal anything obvious, we will of course be more thorough during the next dev test. The memory leak certainly looks plugged. I let the game screen run for a couple hours and it stayed around ~33 MB; the full sim stayed ~64 MB. Great work fixing this one, seemed like a good amount of work 😄! Back to you to close or mark for verification in the next dev version. |
Our work here is done. Any collateral damage will be ferreted out by the next dev test. |
http://www.colorado.edu/physics/phet/dev/html/graphing-lines/1.2.0-dev.1/graphing-lines_en.html?screens=4&fuzzMouse to isolate just the game screen. Heap snapshot recorded every 1 minute.
(No, I'm not missing decimals. It reached ~1 GB in 3 minutes)
Compared to http://www.colorado.edu/physics/phet/dev/html/graphing-lines/1.2.0-dev.1/graphing-lines_en.html?screens=1,2,3&fuzzMouse to show memory without the game screen. The sim performs fine with the game screen excluded.
To bring merit to this memory leak, I've tested the Game screen on an iPad 2 iOS 9.3.5. In this version of graphing-lines, mobile Safari will crash after ~2-3 complete runs of a level (the level in question does not seem to matter much). Throughout the level, there are slight hangs as each next challenge loads, and one large hang before each reward screen.
For the record, here is graphing-slope-intercept. Basically the same results: http://www.colorado.edu/physics/phet/dev/html/graphing-slope-intercept/1.0.0-rc.1/graphing-slope-intercept_en.html?screens=2&fuzzMouse
Seen on macOS 10.12.4 Chrome and iPad 2 iOS 9.3.5. For phetsims/tasks#815 and phetsims/tasks#816.
URL: http://www.colorado.edu/physics/phet/dev/html/graphing-lines/1.2.0-dev.1/graphing-lines_en.html?screens=4&fuzzMouse
Version: 1.2.0-dev.1 2017-04-12 20:14:47 UTC
Features missing: touch
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
Language: en-US
Window: 870x650
Pixel Ratio: 1/1
WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium)
GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit (WebKit WebGL)
Vertex: attribs: 16 varying: 32 uniform: 1024
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 80)
Max viewport: 16384x16384
OES_texture_float: true
Dependencies JSON: {"assert":{"sha":"a707328c","branch":"HEAD"},"axon":{"sha":"81919d26","branch":"HEAD"},"babel":{"sha":"fdde4356","branch":"master"},"brand":{"sha":"054ca5c3","branch":"HEAD"},"chipper":{"sha":"6218b3c7","branch":"master"},"dot":{"sha":"a0c5770e","branch":"HEAD"},"graphing-lines":{"sha":"032bc04e","branch":"master"},"joist":{"sha":"91516011","branch":"HEAD"},"kite":{"sha":"81166ce9","branch":"HEAD"},"phet-core":{"sha":"c5c6c2a8","branch":"HEAD"},"phetcommon":{"sha":"68053a7d","branch":"HEAD"},"query-string-machine":{"sha":"d8a4ff18","branch":"HEAD"},"scenery":{"sha":"17b5a7e4","branch":"HEAD"},"scenery-phet":{"sha":"8ea5852c","branch":"HEAD"},"sherpa":{"sha":"0e326d54","branch":"HEAD"},"sun":{"sha":"50c6a1d0","branch":"HEAD"},"tandem":{"sha":"18703f2f","branch":"HEAD"},"vegas":{"sha":"3c3561d2","branch":"HEAD"},"vibe":{"sha":"49fdbe7d","branch":"HEAD"}}
The text was updated successfully, but these errors were encountered: