Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is All heap Allocations and All Anonymous Allocations in Xcode Instruments allocations?

I hava an application . when I repeat some action , anonymous allocations memory continuously increase a lot while heap allocations increase a little. can some one help me ? Thanks

like image 930
AndyHong Avatar asked Nov 12 '22 19:11

AndyHong


1 Answers

Focus on the Live Bytes column for All Heap Allocations to see how much memory your application is using. You cannot control your application's Anonymous VM size.

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

The VM in anonymous VM stands for virtual memory. When your app launches, the operating system reserves a block of virtual memory for your application. This block is usually much larger than the amount of memory your app needs. When your app allocates memory, the operating system allocates the memory from the block it reserved.

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

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

like image 144
Utsav Dusad Avatar answered Nov 15 '22 05:11

Utsav Dusad