-
Notifications
You must be signed in to change notification settings - Fork 6
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
Prevent crashing on iPad 2 #128
Comments
@jessegreenberg has been investigating Energy Skate Park: Basics crashing on iPad 2 in this issue: phetsims/energy-skate-park-basics#435 |
Launching built version on iPad2: Launching built version on iPad2 with ?fuzzMouse Launching built version on iPad2 with ?fuzzMouse (2nd run) (3rd run) |
I investigated crashing on Energy Skate Park: Basics in phetsims/energy-skate-park-basics#435 (comment) to see if I could find out what the crashing correlates with. But it is very difficult to discern correlations or how we could reduce the problem. Is the behavior acceptable for now? I also have asked a question in phetsims/energy-skate-park-basics#435 (comment) about whether the crashing pattern is the same in the app as it is in mobile safari. |
@samreid let's wait on this issue until we get some data from dev testing. If QA finds that the sim is crashing all the time on iPad2 to the point it's unusable, we may need to do a bit more digging here. Then again, if we truly are dropping iPad2 support, then perhaps we leave things as-is. Either way, we can discuss things more after QA spends some time testing on iPad2. |
Sounds good, thanks. I'll try to label accordingly. |
In the aforementioned issue, we switched from hundreds of shaded sphere nodes to using one canvas. It likely impacts the memory usage, so I should run more crash tests. |
After the SoundParticleLayer canvas, 93 seconds until fuzzMouse crash on built. |
On hold until dev testing. |
Launching a built version with |
Oops, after closing I realized this issue is about iPad 2, not iPad air. Leaving open for further investigation. |
More than 5 minutes of fuzzing on a built version on iPad 2 with no issues (except the fuzzing is notably sluggish). This may have been helped by recent PhET-iO IO type memory fixes, or omitting the fourth screen. In either case, this seems good enough to close this issue, and we can reopen if other problems are found in subsequent dev or RC testing. |
Testing dev.51 on iPad2 today I observed a crash. I subsequently restarted safari, cleared other apps and was able to tap through every screen and every scene and use the simulation for >3 minutes with no crashing. But this sim uses around 60MB of memory, so it could be susceptible to crashing on iPad2. I'll see how far fuzzing goes at the moment. Initial test ran 15 seconds on iPad2 fuzzing before crash. My hypothesis is that Safari already had memory usage when the first test began. Then when safari crashed and restarted, that was cleared. Then in the second test, Wave Interference got to use the full memory and stayed below the crashing threshold for quite some time. Looking around in the Wave Interference heap, I don't see any obvious and easy ways to reduce memory. There are large amounts of Emitters, BooleanProperties and Bounds instances, but many of these are created by common code. I tried throwing away 6 of the 9 CanvasNodes, but this did not yield a measurable difference in heap size (it was 66.4MB either way). Reducing the lattice size from 100 cells squared to 50 cells squared reduces memory usage to 64MB, not a significant savings. |
I can shave off 2.4MB (from 59.5MB to 57.1MB) in requirejs mode with assertions disabled by only declaring PhetioObject properties if PHET_IO_ENABLED. This is pretty hackish though because some of the properties such as tandem and linkedElements, need to be defined anyways, so the solution looks haphazard.
|
Some thoughts:
a) reduce general memory usage without changing functionality--maybe we can find parts of common code or the sim heap that are too bulky and can be reduced. However, it would be unfortunate if this pushes us toward implementing things in less maintainable ways. I fuzz tested Graphing Quadratics 1.0 on this same iPad2 to test for crashing profile, as a comparison. One last point--if we add a fourth screen to Wave Interference, the memory usage is just going to increase. For instance, right now each screen weighs around 20MB. If we can get this to around 15MB per sim, we would have around the same memory footprint as graphing quadratics. Then if we add another screen, this will just push us back where we started. Another possibility--that the crash is due more to memory thrashing (allocation and deallocation) than it is to static size. If that proves to be the case, we could work toward reducing allocations during the runtime of the sim, but this would generally entail changing toward less maintainable code. UPDATE: Another data point: testing the built Wave Interference dev.51 on iPad 2 shows the same behavior as before. First crash at around 10 seconds, then next run goes for >10 minutes without crashing. @ariel-phet what do you think and how do you recommend to proceed? |
Another possibility: even though the allocated canvas sizes don't show up on the heap, they may still contribute to iPad 2 crashing. It would lead to very hackish code but we could try creating only one LatticeCanvasNode and passing it to each screen. I'm not sure how layering would work or if scenery still allocates multiple Here's the URL I've been testing with: |
Notes from discussion with @ariel-phet:
|
@KatieWoe were there any iPad 2 tests run during the dev test? Here is a note from the dev request:
|
I did some testing for about 7 - 10 minutes and did not see any crashes. @samreid |
Sounds good, thanks for testing, closing. |
The simulation shouldn't crash on iPad 2. I'll investigate how frequently it crashes and whether there is a way to crash less.
The text was updated successfully, but these errors were encountered: