AndEngine 游戏中的延迟问题,Heap DDMS 解决方案

发布于 2024-12-29 14:10:08 字数 243 浏览 2 评论 0原文

我正在使用 andengine 开发游戏。

在我的游戏中,我将精灵放置在场景中,我使用池来重新使用已经分配的精灵。

我注意到整个游戏过程中出现了几次冻结。

我被告知要查看 Eclipse 中 DDMS 工具中的堆。

这是我的样子,我不太明白。这是坏还是好?谁能告诉我其中一些是什么意思?

堆

I am developing a game with andengine.

Throughtout my game i place sprites on the scene, i am using a pool to resuse sprites already allocated.

I notice a few freezes throughout my game.

i was told to look at the heap in the DDMS tool in eclipse.

Here is how mine looks, I dont really understand it. Is this bad or good? Could anyone tell me what some of these things mean?

Heap

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

靖瑶 2025-01-05 14:10:08

我看不出这里有什么特别的。精灵本身并不占用太多内存(我想说少于 500 字节)。占用内存的是纹理 - 但如果您在游戏中加载一次它们(onLoadResources),那么冻结与内存问题无关。

还有什么问题?例如,过于频繁地调用 System.gc。您应该跟踪这些冻结并找出它们发生的地点和时间。

I don't see anything special here. Sprites themselves don't take much memory (I'd say less than 500 bytes). What takes memory is the textures - but if you load them once in your game (onLoadResources) then the freezes are not related to memory issues.

What else could be the problem? Calling System.gc too often, for example. You should track these freezes and find where and when they occur.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文