GFX Buffer Memory leak when destroy spine node

I write simple component to test spine on web:

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

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

When remove spine node, gfx memory buffer doesn’t decrease. Please see my video.

Which version of creator are you using?

I use cocos creator 3.4.2

I used the memory viewer tool to look at the interval, the memory increase is not a lot. how you see GFX buffer memory leak?

I see profiler text on bottom-left game concern and profiler of chrome as you used. I write some code custome engine to test here

It seems that the problem comes from the material memory of spine. It increase slow but when play game long time it become larger. It becomes more serious in my game due to it being used a lot of spine created and destroy frequently.

I use script test with sprite node destroy, but it not increase as spine node.

How long does it need to run before there is a problem?

As the video I attached above, it only takes a few seconds to leak, it leaks very slowly (if you create and destroy many spine it will be faster). On my game, I need to play continuously for more than 1 hour until the browser crashes on iphone 8. Phones with less ram will crash faster

This is a bug, a new issue has been created, you can follow the progress of the fix, thanks for the feedback.

1 Like