Skip to content

内存溢出 #1003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pojol opened this issue May 20, 2025 · 0 comments
Open

内存溢出 #1003

pojol opened this issue May 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@pojol
Copy link

pojol commented May 20, 2025

描述Bug

游戏运行时内存正常,但点击微信重新启动游戏,或每次开关游戏会导致
开发调试面板中的 memory used 内存增长(微信内存)且不会释放,只有当重启微信后才会正常

怀疑是 当前场景的 OnDestory 在点击重新启动游戏(右上角)时未被正常调用

通过在 OnDestory 函数中埋向服务器发送的日志发现, 游戏内场景切换可以正常获取到日志,重启没有

请问有什么 API 或者 调试工具 可以排查这个问题吗?

运行环境

macos
unity2022.3
wx-sdk版本 v0.1.26
assets 导入
webgl

后续我为了解决这个问题,尝试将游戏中的代码删除,只留一个主场景 和空的
start, update, ondestory 函数, 结果发现重启还是会导致内存的增长 ...

@pojol pojol added the bug Something isn't working label May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant