gpt4 book ai didi

ios - Xcode Instruments 分配中的所有堆分配和所有匿名分配是什么?

转载 作者:可可西里 更新时间:2023-11-01 06:09:52 25 4
gpt4 key购买 nike

我有一个应用程序。当我重复一些 Action 时,匿名分配的内存不断增加很多,而堆分配则增加了一点。有人能帮我吗 ?谢谢

最佳答案

关注所有堆分配的事件字节数列,以查看您的应用程序使用了多少内存。您无法控制应用程序的匿名 VM 大小。

Focus on the heap allocations because your app has more control overheap allocations. Most of the memory allocations your app makes areheap allocations.

The VM in anonymous VM stands for virtual memory.When your app launches, the operating system reserves a block ofvirtual memory for your application. This block is usually much largerthan the amount of memory your app needs. When your app allocatesmemory, the operating system allocates the memory from the block itreserved.

Remember the second sentence in the previous paragraph. The operatingsystem determines the size of the virtual memory block, not your app.That’s why you should focus on the heap allocations instead ofanonymous VM. Your app has no control over the size of the anonymousVM.

来源:http://meandmark.com/blog/2014/01/instruments-heap-allocations-and-anonymous-vm/

关于ios - Xcode Instruments 分配中的所有堆分配和所有匿名分配是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19555161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com