如何释放iphone中的系统库分配(框架相关)

发布于 2024-12-05 19:57:37 字数 522 浏览 0 评论 0原文

我面临着系统库分配的大问题。
我没有从我的应用程序中得到任何泄漏,仍然有这么多的分配。我附上了各种屏幕截图。在我的应用程序中,使用自定义选择器从断言库中获取所有图像。这些图像是从在滚动视图上显示图像的选择器中选择的。 在此处输入图像描述

当我的应用程序在滚动视图上显示 35 个图像时的屏幕截图。如果我再次从自定义选择器分配中选择图像增加。我看到对象详细信息全部与框架工作分配相关。不是来自我的应用程序 在此处输入图像描述 查看分配对象列表响应库是 DYLD。在此处输入图像描述 在此处输入图像描述 这是我的泄漏屏幕截图

我们如何释放这些分配?请帮我一下?

i m facing big problem with system libraries allocations.
i didn't get any leaks from my application still so much allocations.i attached various screen shoots. in my application using custom picker which get all images from assert library.which are pick from picker showing images on scroll view.
enter image description here

its screen shot when my app with 35 images on scroll view.if again i pick images from custom picker allocation increased.i am seeing object details its all related to frame Work allocations.not from my application enter image description here
see the allocation object list response library is DYLD.enter image description here
enter image description here
its my leaks screen shot

how can we release these allocations? please help me out ?

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

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

发布评论

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

评论(2

执妄 2024-12-12 19:57:37

仅仅因为没有泄漏并不意味着您正在正确管理内存。你所遇到的就是我所说的记忆膨胀——你保留它的时间超过了你需要的时间。 (泄漏是分配没有引用的内存。膨胀是分配有引用但不应该有引用的内存。)

http://www.friday.com/bbum/2010/10/17/when-is-a-leak-not-a-leak-using-heapshot-analysis-to-find-undesirable- memory-growth/ 将为您提供一些使用 Instruments 来查找它们的好策略。 (这是一个非常可靠的消息来源,据我所知他仍然在苹果公司工作。)

Just because you have no leaks doesn’t mean you are managing memory correctly. What you have is what I call memory bloat — you are retaining it longer than you need to. (A leak is allocated memory with no references. Bloat is allocated memory that has a reference but should have none.)

http://www.friday.com/bbum/2010/10/17/when-is-a-leak-not-a-leak-using-heapshot-analysis-to-find-undesirable-memory-growth/ will give you some good strategies for using Instruments to find them. (This is a very credible source, so far as I know he still works at Apple.)

凉宸 2024-12-12 19:57:37

确保您的应用程序没有泄漏的对象,它们也会在仪器中消失。当然它指向一个系统库,但它总是你的错误的结果。选择其中之一并打开右侧视图。也许它会向您显示正确的代码堆栈和分配的代码行。
您可以做的另一件事:运行静态分析器 Product->Analyze 它将发现所有(至少大部分)泄漏;)

make sure your application has no leaked objects and they will also disappear in instruments. For sure its pointing to a system library but it is always a result of your bugs. Select one of them and open the right view. Probably it will show you the right code stack and the allocated line of code.
The other thing you can do: run the static analyzer Product->Analyze it will find all (at least most) your leaks ;)

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