Saturday, July 16, 2022
HomeGame DevelopmentGFX Buffer Reminiscence leak when destroy backbone node - Cocos Creator

GFX Buffer Reminiscence leak when destroy backbone node – Cocos Creator


I write easy element to check backbone on internet:

import { _decorator, Element, sp, instantiate, Node } from 'cc';
const { ccclass, property } = _decorator;
 
@ccclass('TestPerformance')
export class TestPerformance extends Element {
    @property({kind: Node})
    nodeRender = null;

    replace(dt)
    {
        let node = instantiate(this.nodeRender);
        this.node.addChild(node);
        node.energetic = true;
        setTimeout(()=>{
            node.energetic = false;
            node.getComponent(sp.Skeleton).destroy();
            node.destroy();
        }, 200);
    }
}

When take away backbone node, gfx reminiscence buffer doesn’t lower. Please see my video.


Which model of creator are you utilizing?

I take advantage of cocos creator 3.4.2

I used the reminiscence viewer software to have a look at the interval, the reminiscence improve just isn’t rather a lot. the way you see GFX buffer reminiscence leak?

I see profiler textual content on bottom-left sport concern and profiler of chrome as you used. I write some code custome engine to check right here

Evidently the issue comes from the fabric reminiscence of backbone. It improve sluggish however when play sport very long time it turn into bigger. It turns into extra critical in my sport as a consequence of it getting used quite a lot of backbone created and destroy continuously.

I take advantage of script check with sprite node destroy, nevertheless it not improve as backbone node.

How lengthy does it have to run earlier than there’s a downside?

Because the video I connected above, it solely takes a couple of seconds to leak, it leaks very slowly (for those who create and destroy many backbone it will likely be quicker). On my sport, I have to play repeatedly for greater than 1 hour till the browser crashes on iphone 8. Telephones with much less ram will crash quicker

It is a bug, a brand new problem has been created, you may comply with the progress of the repair, thanks for the suggestions.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments