iPhone内存管理

发布于 2024-11-25 18:10:10 字数 212 浏览 3 评论 0原文

我一直在使用仪器来检查程序中的泄漏和其他内存问题。尽管仪器发现的泄漏非常小并且无关紧要,但我发现当我使用该程序时,物理内存空闲量不断下降。

我使用内存监视器来确定我的应用程序使用了多少内存,并使用分配来确定这主要发生在哪里。我总是确保每次分配或保留时都进行释放,并且看到几乎没有任何泄漏,我假设我的内存管理很好。

有谁知道我可以做什么来解决这个问题或推荐一种方法来解决这个问题?

I have been using instruments to check for leaks and other memory issues in my program. Though the leaks found by instruments are extremely small and don't matter, I have found that the physical memory free keeps going down while I use the program.

I use memory monitor to determine how much memory my app is using up and allocations to determine where this is mainly happening. I always make sure to release every time I alloc or retain, and seeing how there are barely any leaks, I'm assuming that my memory management is fine.

Does anyone know what I can do to fix this issue or reccomend a way to get to the bottom of it?

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

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

发布评论

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

评论(1

帅气称霸 2024-12-02 18:10:10

即使您释放了不需要的对象,也没关系。您可能分配了太多的东西,但出于某种原因保留了它们。您可以尝试检查一下:

http://macdevelopertips.com/objective -c/objective-c-memory-management.html

http://akosma.com/2009/01/28/10-iphone-memory-management-tips/

我建议您检查一下您分配的内容以及终生保留的内容的应用程序,看看你是否可以做同样的事情,但不使用这么多的内存。

编辑:我必须同意 Mark 和 Kongress 的观点,每次泄漏对于你的应用程序的生命周期都很重要。

Even tho you release objects you dont need, that doesn't matter. You are probably allocating too much things and keeping them for some reason. You can try to check this out:

http://macdevelopertips.com/objective-c/objective-c-memory-management.html

http://akosma.com/2009/01/28/10-iphone-memory-management-tips/

I would advise you to check what you alloc and what you keep for the life of the application and see if you can make the same thing but without using so much memory.

Edit: I have to agree with Mark and Kongress, every leak matters for the sake of your app's life.

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