Closed SethTisue closed 9 years ago
My first thought here was video memory. I know really huge canvases, or too many canvases can crash browsers. But I don't think that's it. Voting's turtle canvas is 1349x1349 vs vants's 1134x1134 and termites's 1350x1350. The patch canvas is always smaller. Both fire and voting don't use turtles, so the shape cache eating memory can't be the problem either.
The thing that sets those models apart is the massive amounts of patches. Voting is 151x151 and fire is 251x251. However, in desktop chrome, when I took a heap snapshot of fire, it was only 34.3 MB. So unless iOS has a problem with really massive objects (the object storing patches is 27 MB), I'm not really sure...
Of course, the massive amount of patches do mean each tick takes a nontrivial amount of time. Safari could be just killing what it thinks is an unresponsive tab.
In what way does it crash? Does Safari actually shut down, or does the page itself just crash?
The page loads, then you press the setup button, and then (after only about 3 or 4 seconds) Safari shuts down entirely. No error message, just gone.
In my experience, the crashes are consistent: a model either crashes Safari during setup or it doesn't, and if it does, it crashes it every time. And yes, the crashing models are exactly the ones with lots of patches.
(Also, slight correction just FYI: Fire uses turtles. There is a patch-only version out there, but the main version in Sample Models has turtles.)
Apparently mobile Safari limits script execution to 10 seconds, with "unintended consequences" if things go longer than that. See Here for more information. There is a server-side bug around over-large JSON bodies as well , maybe we could kill two birds with one stone?
I think this issue properly belongs in NetLogo/Tortoise, so I'm going to close it as a duplicate of NetLogo/Tortoise#168
with the current code (running at http://ccl.northwestern.edu/tortoise/2013-10-25/) small models like Vants and Climate Change work, but bigger votes ones like Voting and Fire crash Safari hard
confirmed on netlogo-devel by Simone Gabbrielli that it isn't just my iPad doing this (he's on iOS 7 too)