-
Notifications
You must be signed in to change notification settings - Fork 8
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
iPad2 Crash #62
Comments
I saw a few circumstances on iPad2 where objects would no longer drag (though some items were tappable), perhaps related to this issue? |
Previously noted in phetsims/circuit-construction-kit-common#370 |
Running with ?fuzzMouse on desktop, I'm still seeing
And running ?fuzzMouse on the iPad seems like a reliable way to reproduce this problem. So far popupDisplay has been unresponsive during fuzzMouse. |
Joist disables popping up windows while fuzzing: // override window.open with a semi-API-compatible function, so fuzzing doesn't open new windows.
if ( phet.chipper.queryParameters.fuzzMouse ) {
window.open = function() {
return {
focus: function() {},
blur: function() {}
};
};
} I had to comment that out to get this working. When I did, I saw that ValueNodes are sneaking in between the webgl nodes and some changes: |
I fixed the layering above and now it seems the WebGL layer isn't getting split up. Still need to test on iPad2. |
I published the fix in http://www.colorado.edu/physics/phet/dev/html/circuit-construction-kit-dc/1.0.0-dev.77/circuit-construction-kit-dc_en.html but it still crashed after 20 seconds of fuzzing on the iPad2. |
When running tethered with Safari, the app crash closes the tether page, so it appears I cannot use that for diagnostic. |
Running with ?webgl=false starts at 94Mb. Dragging everything out of the Lab carousel page 1 leads to 160MB (still not crashed). |
I used the WKWebView example from http://applecocoa.com/swift-3-wkwebview/ Had to restart iPad when instrument was loading blank. |
With ?screens=1 I'm still seeing 100MB usage, then up to 140MB with everything dragged out of the toolbox. |
Even when I added this cache busting code, it was still loading a cached version: |
I disabled all caching in my apache and that worked: But using image! instead of mipmap! I'm still seeing 122MB used. |
Summarizing findings: |
@jonathanolson and I hit "edit" in the safari dev tools (basically following https://webkit.org/blog/6425/memory-debugging-with-web-inspector/ ) and saw this breakdown: |
@jonathanolson suggested trying these changes to Node.toDataURLNodeSyncrhonous: toDataURLNodeSynchronous: function( x, y, width, height ) {
assert && assert( x === undefined || typeof x === 'number', 'If provided, x should be a number' );
assert && assert( y === undefined || typeof y === 'number', 'If provided, y should be a number' );
assert && assert( width === undefined || ( typeof width === 'number' && width >= 0 && ( width % 1 === 0 ) ),
'If provided, width should be a non-negative integer' );
assert && assert( height === undefined || ( typeof height === 'number' && height >= 0 && ( height % 1 === 0 ) ),
'If provided, height should be a non-negative integer' );
var result;
this.toDataURL( function( dataURL, x, y, width, height ) {
var img = document.createElement( 'img' );
img.src = dataURL;
result = new scenery.Node( {
children: [
new scenery.Image( img, { x: -x, y: -y, initialWidth: width, initialHeight: height } )
]
} );
}, x, y, width, height );
assert && assert( result, 'toDataURLNodeSynchronous requires that' );
return result;
}, |
On the iPad, this is showing as 130MB on startup. |
@ariel-phet, would it be an option to find someone familiar with diagnosing memory issues (or who is familiar enough with browser internals) to consult on this? It seems to be an issue we're running into repeatedly lately, and I'm not familiar enough with the tools to easily identify what is taking up the memory, and how we can fix it. |
Gaining very little information per hour of investigation. |
@jonathanolson certainly an option...I just am not quite sure where I would find someone with that expertise. I will see if my friend from pivotal has any suggestions on a consultant. |
We used to consult with Sam Breed of Quick Left on Pearl, not sure if he is still around. |
I noticed there are 521 Property instances upon startup, and Chrome reported |
Could also do for VertexNode and SolderNode what we did for ChargeNode: 1082 VertexNode 1344 pickable hits inputListeners translated [Trail 1.5.1.92] undefined 230f |
Perhaps a good time to test this hypothesis?
|
Investigation in reducing allocations while dragging seems promising (though with the caveat that it seems there are unknown variables here and it is perhaps difficult to reproduce experiments exactly without rebooting the iPad between each run). UPDATE: but the last result in #74 was without a reboot |
3 minutes and 47 seconds of continuous use on iPad2 and no crash. However I did find a bug that the cut button isn't cutting wires. |
?fuzzMouse survived iPad2 for 52 seconds. |
I think it would be nice to get some QA testing on this when a dev version is ready for QA team testing. |
@samreid once you feel you have a stable version, go ahead and create a QA task, feel free to immediately label it "top-priority" and assign to @phet-steele |
@phet-steele according to phetsims/qa#26 iPad2 received some dev testing. Any crashes? How thorough was your testing? Can this issue be closed? |
I had no crashes! The performance was decent but not great. I did not really push it to its limits, nor do I think I really ever had too many objects out at once, though. I was planning on really going at the iPad 2 after the AAPT stuff had blown over, so please keep open. |
We'll need to test crashiness again after increasing the WebGL backing scale, see #139 |
Now that we are rendering everything with SVG we should check again for iPad crashiness. |
My mistake, what I originally tested on was an iPad air 2. After testing on an iPad 2 it did not crash and the same trends are true (conventional performs better than electrons, and schematic better than realistic), but the performance was much worse across all modes, and decreasing much faster. It was showing 3 fps in a circuit similar to above. |
Thanks for your testing Bryce. Since it no longer crashes on iPad2, will you please close this issue and create a new issue about dropping to 3 frames per second in that case? Assign the new issue to @ariel-phet to decide if we want to address it. |
moved to #160 |
This happened every couple of minutes on the iPad2. Discovered during testing in #47
The text was updated successfully, but these errors were encountered: