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.
linrm
July 4, 2022, 9:06am
2
Which version of creator are you using?
I use cocos creator 3.4.2
linrm
July 5, 2022, 10:30am
4
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
linrm
July 15, 2022, 3:24am
8
This is a bug, a new issue has been created, you can follow the progress of the fix, thanks for the feedback.
opened 03:22AM - 15 Jul 22 UTC
Bug
ECO: Feedback
Module: 2D
### Cocos Creator version
3.4.2 3.5.2
### System information
web
### Issue d… escription
Question feedback from:
https://discuss.cocos2d-x.org/t/gfx-buffer-memory-leak-when-destroy-spine-node/56514
spine resource frequent release , causes GFX Buffer Mem growth.
### Relevant error log output
_No response_
### Steps to reproduce
here is the demo:
[56514.zip](https://github.com/cocos/cocos-engine/files/9117509/56514.zip)
run the demo , then will see the GFX Buffer Mem grow continuous.

An attempt has been made to call destroyRenderData, it doesnot work.
### Minimal reproduction project
_No response_
1 Like