Skip to content

Resolve potential OOM (Out-Of-Memory) issues in the Spine runtime for web platforms.#18610

Merged
dumganhar merged 9 commits intococos:v3.8.7from
bofeng-song:spine_oom
Apr 17, 2025
Merged

Resolve potential OOM (Out-Of-Memory) issues in the Spine runtime for web platforms.#18610
dumganhar merged 9 commits intococos:v3.8.7from
bofeng-song:spine_oom

Conversation

@bofeng-song
Copy link
Copy Markdown
Contributor

@bofeng-song bofeng-song commented Apr 14, 2025

Re: #
cocos/cocos-test-projects#916
https://forum.cocos.org/t/topic/166062
cocos/cocos-engine-external#485

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@bofeng-song bofeng-song requested a review from dumganhar April 14, 2025 07:03
@bofeng-song bofeng-song reopened this Apr 15, 2025
@dumganhar
Copy link
Copy Markdown
Contributor

@cocos-robot run test cases

@github-actions
Copy link
Copy Markdown

Code Size Check Report

Wechat (WASM) Before After Diff
2D Empty (legacy pipeline) 1006139 bytes 1006139 bytes ✅ 0 bytes
2D All (legacy pipeline) 2668665 bytes 2669478 bytes ⚠️ +813 bytes
2D All (new pipeline) 2756873 bytes 2757686 bytes ⚠️ +813 bytes
(2D + 3D) All 10010462 bytes 10011275 bytes ⚠️ +813 bytes
Web (WASM + ASMJS) Before After Diff
(2D + 3D) All 16924878 bytes 16927398 bytes ⚠️ +2520 bytes

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -53368,9 +53368,8 @@
             protected _animationQueue: __private._cocos_spine_skeleton__AnimationItem[];
             protected _headAniInfo: __private._cocos_spine_skeleton__AnimationItem | null;
             protected _isAniComplete: boolean;
             protected _playTimes: number;
-            protected _needUpdateSkeltonData: boolean;
             protected _listener: __private._cocos_spine_track_entry_listeners__TrackEntryListeners | null;
             _vLength: number;
             _vBuffer: Uint8Array | null;
             _iLength: number;

@github-actions
Copy link
Copy Markdown

@bofeng-song, Please check the result of run test cases:

Task Details

@github-actions
Copy link
Copy Markdown

@bofeng-song, Please check the result of run test cases:

Task Details

@dumganhar dumganhar merged commit a6c5ce0 into cocos:v3.8.7 Apr 17, 2025
33 checks passed
@gaojie111119
Copy link
Copy Markdown
Contributor

TrackEntry will be free after _queue->drain() fire EventType_End or EventType_Dispose. this pr cache TrackEntry and delay to do callback, this may cause an error on spineListenerCallBackFromJS to read SpineWasmUtil::s_currentEntry

@bofeng-song
Copy link
Copy Markdown
Contributor Author

s_currentEntry

Thanks for your feedback, I'll check it

@gaojie111119
Copy link
Copy Markdown
Contributor

s_currentEntry

Thanks for your feedback, I'll check it

提供一个合并这个pr之前的报错堆栈(两个存在大量spine的节点在点击事件中互相切换显隐并重新播放动画)
img_v3_02ll_95d07613-cbe3-4437-86f6-3eff7045e5fg。合并这个pr后这个报错确实不发生了,但是在某些情况下 spineListenerCallBackFromJS 处会报错

@bofeng-song bofeng-song mentioned this pull request Apr 27, 2025
6 tasks
AILHC pushed a commit to AILHC/cocos-engine that referenced this pull request May 19, 2025
…cos#18610)

(cherry picked from commit a6c5ce0)

# Conflicts:
#	native/cocos/editor-support/spine-wasm/spine-skeleton-instance.cpp
#	native/external-config.json
@bofeng-song bofeng-song deleted the spine_oom branch May 19, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants