What does “Anonymous VM" mean in distribution media?

I get frequent memory warnings in my application, but I don't know why. Below is a snapshot of the distribution tools.

Instruments

I know that we have no control over the virtual memory assigned to us, but I'm trying to understand what information is this 26.50 MB number for the developer.

  1. What does a high VM means?  Does it lead to a jetsam?  Is that cause of any other concern?
  2. Is this value dependent on device?
  3. Does a low vm means that your app is memory efficient 
  4. Does a high VM leads to memory warnings in your app?
  5. What cause this value to change? 
  6. What steps should a developer take when they see a high vm for their app (like 300 MB)? 
  7. Is VM tracker instrument related to this value?

+6
source share
1 answer

Anonymous VM covers a lot of things, some of which are things that you want to minimize, and some that are usually less important. The short version of "anonymous VM" is that it is addressed to you, but not named. Allocating the heap gets "named", which allows you to track them as objects. But there are many (and many) non-objective things that fall into the bucket of an “anonymous VM”.

Things allocated with malloc may end in this area. But also files with memory mapping. Your executable file is a memory-mapped file, but since it never gets dirty, parts of it can be changed. So "it's hard." But in big, vague terms, yes, you take care of this section, but you can not worry about all this. Heap allocation tends to keep track of your ObjC stuff. An anonymous VM often monitors that you do not have much direct control (for example, CALayer backup storage).

All that said, the output of the tools you provide does not look like a serious problem. I suspect that this does not indicate the time when you click on the memory. You need to get into a situation with a warning about memory and see what happens next, and understand the specifics of what memory uses.

For more information on this, you should see the WWDC 2013 704 session, “Creating Effective OS X Applications,” which is pretty much deepened for the most part. While iOS has a slightly different memory system, and some OS X tools are not available on iOS, many of them are still in use.

+8
source

Source: https://habr.com/ru/post/987426/


All Articles