12, iOS system memory mechanism

Memory mechanism features

  • Limited free space
  • Low memory warning
  • There is no memory switch system,
    is in the memory of the tense time, will not be temporarily unused memory replacement to the hard disk, PC machine has this mechanism
  • The use of virtual memory paging mechanism of
    5kB as a Page, not all Page will be mapped to the Page, there are three types of Nonresident show that the Page is not mapped to memory Resident and clean when the readonly file is loaded into memory Page is clean memory, such as framework, executable file, by MMAP (memory mapping) read files are Resident and clean, when memory pressure will be unload out, and when needed and load Resident and dirty clean back page is dirty, the memory only when it is killed in the process of being recovered.
    malloc application memory, if not used, is the Nonresident state, used is the dirty state,
    , MMAP, where the file came in, which is the clean state, the other place is the Nonresident state