http://jsfiddle.net/ES4xG/8/ crashes most retina devices.
iOS Safari "easily" runs out of memory and crashes when using some -webkit-transform
instructions. This approach delivers impressive graphics but, especially on retina displays, just seems to consume a lot of memory and cause crashes.
The demo above shows a text displayed 150 times that would otherwise run normally on a PC browser:
The font size and number of elements is exaggerated to cause a crash. The -webkit-transform: translate3d(0,0,0)
is intended to force GPU accelerated drawing of each element.
In the real application, we are using translateX
,Y
,Z
, scale
and others that seem to be connected to GPU use in the same way. Images and sprites are also used, but they are not connected to crashes directly.
Given the scenario above:
1) Is it a bug that iOS Safari is crashing?
2) Plugging in Apple Instruments Memory Monitor, Virtual Memory climbs and seems to be the culprit of the crash. What exactly is using this memory?
3) Is there any other GPU accelerated approach that would not consume a lot of memory?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…