查找我分配的内存
我正在制作一款 Android 游戏,当然我不会在游戏过程中分配内存。
不过,我很确定我没有分配任何内存,并且已经广泛地涵盖了寻找内存分配的代码。我还没有找到。
但是当我在手机上运行游戏时,我发现第一轮有点不稳定,当我查看 Catlog 时,我发现 GC 运行得相当频繁。 GC 大约每 3 秒运行一次。第一轮比赛结束后。 GC 大约每 10 秒运行一次。
除了查看代码来查看分配的内容之外,还有其他方法吗?这是一款 Android 游戏,但我也可以在 PC 上运行它(Libgdx),因此我可以使用 Android 特定解决方案和 java 解决方案。
I am making an Android game and of course I refrain from allocating memory during game-play.
However I am pretty sure I am not allocating any memory, and have covered the code extensively looking for memory allocations. I have not found any.
But when I run my game on my phone I see it's a little jumpy for the first round, and when I look at the Catlog I see that the GC is running pretty often. The GC runs about once every 3 seconds. After the first round of the game. The GC runs about once per 10 seconds.
Is there a way other then looking at code to see what is being allocated? This is an Android game but I am able to run it on the PC as well (Libgdx), so I can use both Android specific solutions and java solutions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论