Pixi.js: Application crash on multiple stage resize on ios devices

Created on 10 Nov 2020  路  7Comments  路  Source: pixijs/pixi.js

Something goes wrong on app.renderer.resize in safari or chrome on ios.
Usual case for stage resize is device orientation change. App crash happened after 3-4 rotations.
Here is example which just resize stage every 0.7s: https://codepen.io/Insi04/pen/XWKxwOe
It crashed on ios devices after 3-10 cycles.
Not reproduced on android or windows.

So, looks ios-side, but maybe any workarounds or other ideas:)

UPD: also reproduced on v4 (but maybe more iterations because of no autoDensity setting - more pixels more leaks i think) https://codepen.io/Insi04/pen/OJXaLLo
UPD2: check samples without pixi: resizing empty canvas, canvas with 2d content, canvas with simple webgl content, canvas examples from https://webglsamples.org - no crashes found.
UPD3: not reproduced on ios 13.6

Environment

Most helpful comment

Any workaround for this?

As I think the only way is not resize canvas, e.g. create square oversized canvas and use just part of it for your render. But it will produce performance issues I think.
Also you could investigate dependencies of crash, because its different on different apps - I need just 2-3 rotations in my app.

UPD: just checked ios 14.3 public beta - it's already fixed

All 7 comments

Found same issue on threejs https://github.com/mrdoob/three.js/issues/20453
So just close issue if no workarounds available :(

UPD: also reproduced on empty canvas after number of resizes increased.

on an empty canvas o_O. Oh boy.
Thanks for the update!

I am seeing similar issues with our apps. It reloads after 5-10 rotates for iOS 14.1 & 14.2

Any workarounds?

Same issue here, calling renderer.resize(width, height) after device rotation. works approximately 20 times then page reload and in chrome - ios it reloads and second time the page crashes.

Any workaround for this?

Any workaround for this?

As I think the only way is not resize canvas, e.g. create square oversized canvas and use just part of it for your render. But it will produce performance issues I think.
Also you could investigate dependencies of crash, because its different on different apps - I need just 2-3 rotations in my app.

UPD: just checked ios 14.3 public beta - it's already fixed

For the time being I will force canvas render until iOS 14.3 is released. For my application performance is good enough.

The resizing of the renderer increases the memory usage each time, until it runs out of memory and crashes. On a new iPad with lots of memory it can take some time before it crashes, but on an older one it will happen pretty fast.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

st3v0 picture st3v0  路  3Comments

courtneyvigo picture courtneyvigo  路  3Comments

Makio64 picture Makio64  路  3Comments

sntiagomoreno picture sntiagomoreno  路  3Comments

distinctdan picture distinctdan  路  3Comments