egret-core icon indicating copy to clipboard operation
egret-core copied to clipboard

在Chrome浏览器下,大量文本或Graphics 会导致奔溃 Out of Memory

Open qiwucwb opened this issue 5 years ago • 0 comments

随便添加大量 的 文本 或者 graphics 的到舞台上,过一会 内存就会暴涨(不是 js heap 内存),然后就 奔溃了 Out of Memory。 大概不是 egret 的问题。 目前已知 chrome版本<=68 无问题,,>=78有问题 ,68~78之间的没测过。 egret引擎版本 5.2.33 和 5.0.14都用过,应该不是引擎问题。

示例代码(随便添加大量的 文本 或者 graphics 到舞台上)

for (let i = 0; i < 3000; i++) {
            let sp = new egret.Sprite();
            //    let sp = new egret.TextField();
            //     sp.text='sfd'
            sp.graphics.beginFill((Math.random() * 0xffffff) | 0, 1)
            sp.graphics.drawRect(0, 0, 100, 100);
            sp.x = Math.random() * 620
            sp.y = Math.random() * 1020
            this.addChild(sp)
}```

qiwucwb avatar Apr 14 '20 07:04 qiwucwb