user@host:% memReport.py Wired Memory: 1381 MB Active Memory: 3053 MB Inactive Memory: 727 MB Free Memory: 1619 MB Real Mem Total (ps): 3402.828 MB (very slightly adjusted to match the tab sizing on StackExchange;). Oct 04, 2012 FreeMemory for Mac is a utility to free up unneeded memory in your Mac OS X device. It is available for free from the App Store and download sites. Apr 24, 2012 Using the ‘purge’ command when Free memory starts to run low prevents the OS from having to use swap by converting (most) inactive memory to free memory. In my experience keeping my Mac from swapping to the disk (and causing Page-Outs) is key to maintaining optimal performance. To all the naysayers preaching about how wrong this advice is.
Mac System Software
Mac OS was named by the company Apple as 'Mac System Software' in the beginning, a specially designed operating system only for 68K first Motorola processors. With own Macintosh hardware, Mac OS takes up a special role in the world of desktop systems. The first version was 'System 1' and appeared bundled with the Mac in 1984. The classic desktop is designed as a single user operating system and almost completely hides the full path to files and directories. The graphic representation is reduced to the essence. Overall the interface is very easy to use and does not need the right mouse button for user interaction. Mac OS does not include a command line interface.Starting with System 3.0, the used filesystem HFS was used officially, which does not different between uppercase and lowercase letters. System 5.0 was the first release to run several programs with the integrated MultiFinder at the same time. The operating system was programmed up to system 6.0 mostly in assembler and partially in Pascal and used a 24-bit addressing mode. Cooperative Multi-tasking could optionally be enabled in System 6. System 7.0 first supported 32-bit addressing. Thus allow the operating system can use more memory and more powerful programs. Since 1994 System 7.5 supported for the first time the PowerPC architecture and is optimized with the following Mac OS versions further on this architecture. With System software 7.6 the name was changed to Mac OS in January 1997.
The optimization of the operating system to the hardware has the disadvantage that the system software can not be installed on every Mac. Application compatibility to the Mac systems may also vary with each version.
2006 MacOS X was presented for the first time publicly on x86 hardware, Apple allows the use of Mac OS X only on specific intel-Macintosh systems. According to Steve Jobs Mac OS X have been developed since 2000 internally parallel for Intel and PowerPC processors. The version of Mac OS X 10.6.0 raised the optimization to Intel-based processors further, the new operating system is no longer available for PowerPC Macintosh or pure 32-bit intel processors. In return the user receives a pure 64-bit operating system optimized for performance on multiple processors. Even the GPU computing power itself can be used with specific applications.
The selection of software is focused on the creative industry and enables such as the professional graphic, audio and video editing. Office applications such as MacWrite, Microsoft Office, OpenOffice and 3D games are also available. The choice of browsers is large with iCab, Microsoft Internet Explorer, Netscape, Opera and Mozilla Firefox. StuffIt is the standard software for file compression.
System 6 (Mac OS)
Mac system software 6 came onto the market in 1988. It requires 1 MB RAM and can address up to 8 MB. The file system can organize hard disks up to 2 GByte with 65,536 files. Optionally applications run with the multi Finder in cooperative multitasking. For word processing are programs such as WriteNow, MacWrite II, and Microsoft Word 4.0 available.System 7 (Mac OS)
The system 7 was first available in May 1991. The new operating system needed 2 MB RAM, optionally it can be switched to 32-bit depending from the used hardware. Cooperative multitasking is now enabled by default, the addressable memory is no longer limited to 8 MB. In addition virtual memory can be enabled.Mac Os Free Memory Download
New is the direct support of networks with file exchange, AppleScript as scripting language and display of colors. Balloons provide help for the user to use the interface. With aliases are icon links to files possible, regardless of the storage location locally or from the network. The TrueType fonts are scalable to any size.
The System Software 7.5 appeared in 1994 and requires at least 4 MB RAM. It was running both on 68k-Macs and Power Macintosh. In September 1996, the update System 7.5.5 includes all available bug fixes, Open Transport 1.1.2, current Ethernet driver and support for storage drive volumes up to 4 GB. With release 7.6 the company Apple changed the name for the operating system from System Software to Mac OS in 1997. At the 31. January 1999 Apple gave the Mac system software 7.5.3 public as free download.
Mac OS 7.6 can be installed on every Mac compatible computer, which contains at least a 68030 processor and supports 32-bit addressing. The 24-bit addressing is no longer supported. Performance is improved in the area of virtual memory and memory management. QuickTime version 2.5 offers better image quality and benefits of multiple processors.
On systems with 68040 or PowerPC processors partitions can be used of up to 2 TByte, systems with 68030 processor remain limited to 4 GB. Check of the disk after a system crash requires now much less time.
Mac OS 8
Mac OS 8 by Apple appeared in July 1997. As minimum requirements are specified a 68040 or PowerPC processor, 32 MB RAM and 120 MB of free disk space. The CTRL key is used to display a specific context menu for different actions. Finder in version 8 is now multithreaded and does no longer breaks other applications during the copy of files. The starting time of the operating system and applications is been reduced. As standard the browser software Microsoft Internet Explorer 3.0 and Netscape Navigator 3.0 are included. Inside of a TCP/IP network can shared files and printers accessed.With Mac OS 8.1 the filesystem HFS+ is included by default. Now informations are stored more efficiently on the file system and does less waste disk space in comparison of HFS. The limit of the partition size is depending on your hardware, the maximum size is now 2 TByte for all Quadra and PowerMac systems. The file system can handle up to 2 billion files with a current file size of up to 2 GB. PC Exchange 2.2 allows users the mount of DOS and Windows drives on your desktop. The supported file systems include FAT12, FAT16, FAT32, VFAT.
Mac OS 8.5 further optimized the stability and speed of the operating system, Sherlock is extended for full-text search in local files and Internet search wizard for the first time. Mac systems with 68k processors are no longer compatible with this version. The throughput in Ethernet networks has been increased, AppleScript is now up to 5 x faster than the previous version. The graphical display is accelerated by new QuickDraw routines. Copying files has become faster and increase the disk throughput. A tool for system maintaining detects and fixes errors on the file system automated. The 'Apple System Profiler' creates comprehensive reports about the used hardware and software.
Following applications are included in current version: Finder 8.5 QuickTime Pro 3, Open Transport 2, Internet Explorer 4.01, Outlook Express 4.01, Netscape Navigator 4.0.5, Mac OS Runtime for Java 2.0 and File Exchange 3.
Mac OS 8.6 requires 250 MB free disk space and 24 MB RAM. A new kernel is included which improves performance and added support for the PowerPC G4 processor. The ability of multitasking and multiprocessing has been optimized further and enhanced with new features.
UDF 1.5.2 allows reading and storing data to DVD-RAM and read of DVD-ROM media.
Mac OS 9
The operating system Mac OS 9 has been developed under the name Sonata and released to the 23. October 1999. The installation requires 32 MB RAM with virtual memory and a PowerPC 601 processor or higher. For models with G3 processor are at least 64 MB RAM recommended for optimal performance. The first G4 and iMac systems until summer 2000 are supported. The free disk storage should be 150 up to 400 MB depending on the installation type.50 new features are added in comparison to the previous version. This includes support for multiple users with password and access management for files and settings. The login is available through authentication by voice. Files can be stored encrypted. The operating system can automatically update itself via the Internet. You can back up all personal passwords with a master password. The integrated search engine Sherlock 2 is extended with language and search templates. The first version 'Carbon' API is available for new applications.
The following applications are included in current version: Finder 9.0, Mac OS Runtime for Java 2.1.4, Apple data security 2.0 and Open Transport 2.5.
Mac OS X
Different technologies like the Mach Kernel, NEXTSTEP and tools from NetBSD and FreeBSD found influence in Mac OS X to merge the previous Apple technology with UNIX features. The operating system core Darwin is open source and can be used also on x86 computers standalone. Mac OS X works with preemptive multi-tasking and includes beside the new GUI Aqua the classic GUI from Mac OS 9.Mac OS X 10.0 came out in March 2001. To install are 128 MB RAM (256 MB RAM starting from Mac OS X 10.3.9) and 1.5 GB hard disk space (3.0 GByte starting from Mac OS X 10.2) provided. Mac OS X 10.5 requires at least 512 MB RAM and 9 GByte of free disk space.
- 32-bit or 64-bit processing
- SMP with up to 32 CPUs
- needs a PowerPC G3, G4 or G5
- POSIX compatible
- HFS+ file system
Field of Application
- digital photography
- 2-D and 3-D animations
- video processing, streaming
- audio processing
- platform for DTP, web design
- office applications
Structure Information
Mac Os Free Memory Requirements
- supports QuickTime/VR
- monolithic Kernel
- Read/Write FAT, FAT32, ISO9660, UDF
- well proven TCP/IP Stack
- graphical user interaction with the finder
- graphical representation by Quickdraw
- central password administration (Keychain)
Considerable performance and comfort improvements were carried out in version Mac OS X 10.1. The surface reacts quicker at user interaction, the system start was accelerated and the OpenGL performance increased noticeable.
Mac OS X 10.3 has now a GUI in metallic scheme and the optimized Finder. The use and access in heterogeneous networks was further simplified. Files can be provided with etiquettes, the compression format ZIP is now directly supported. 12 million MacOS X user were counted in October 2004.
According to Apple Mac OS X 10.4 brings more than 200 new features. Features are the fast, system-wide and index-based search function named Spotlight, the Dashboard for easy access to small programs (Widgets), the Automator for the simplified composition of Applescripts for the automation of tasks. The Web browser Safari in version 2.0 now contained RSS support, the QuickTime software was updated to version 7 with support for the H.264 video codec. Further novelty is the delivery at a DVD medium, an installation of CD-ROM is no longer possible.
First since the 10th January 2006 is MacOS X 10.4.4 next to the PowerPC version available for Intel based Macs. On the 6. June 2005 Steve jobs announced at the WWDC the switch to Intel processors. As further details became known that Apple had developed Mac OS X since 2000 internally also for the Intel platform.
Apple released the successor MacOS X 10.5, Leopard at the 26.10.2007. With more than 300 innovations MacOS offers the user an enhanced user interface with virtual desktops, a fast file preview and Dock with 3D effect. The Finder was revised, the expansion 'Boot Camp' for the installation of Windows on Intel-Macs is an official component now. As a file system ZFS is optionally available. For the surfing on the Internet the Apple Safari 3 Web browser is included. Backups can be made, managed and restored in a simple way with 'Time Machine'. Time Machine makes every hour the day automatically a file backup and every day a snapshot for the duration of a complete month. Lost files are recovered easily over the display of a dynamic time line of those snapshot. The security of the operating system and applications is improved by 11 enhancements. This are beside others the application-based firewall, signed applications, the use of ASLR (Address Space Layout Randomization) and Sandboxing for applications.
Open Group certified MacOS X 10.5 according to the standard UNIX 03 in November 2007. MacOS X is the first free BSD derivative with such certificate to bear the name UNIX officially. The certification guarantees the use of UNIX standard implementations to porting UNIX applications easily.
The first update with bug fixes was released with Mac OS X 10.5.1 by Apple on November 15th, 2007. It contains general bug fixes for the operating system to improve stability, better compatibility and safety. Mac OS X 10.5.2 cames with 125 bug fixes and smaller optimizations on January 24th, 2008.
Mac OS X 10.6 is a Mac computer with Intel Core 2 Duo processor with at least 1 GB memory and 5 GB free space ahead. This operating system no longer exists as PowerPC execution. Apple placed the focus development on performance and stability. It supports up to 16 TByte memory, it is optimized for multi core processors, and is a pure 64-bit operating system. With the technology OpenCL graphics processor can speed up in specific applications calculations.
Apple released macOS 10.12 as free update on 20th September 2016. The new operating system brings the personal assistant Siri to desktop computers. You can also Auto Unlock with your Apple Watch to unlock the computer automatically. The storage management has been optimized to e.g. free up local storage space and easily get rid of duplicate and obsolete files. The Universal Clipboard allows you to copy and paste images, video, and text between all supported devices. Beside of the HFS+ file system you can use the new file system Apple File System (APFS) as a developer preview on data volumes only. Highlights of APFS are e.g. native encryption, optimization for Flash/SSD storage and the Apple software ecosystem. It is planned that APFS will be the default file system for all Apple products in 2017.
Mac OS 1.0 Desktop | Mac OS 2.0 Desktop | Mac OS 3.0 Desktop | System 6, Macintosh Finder |
System 6, system directory | System 6, system control | System 6, find file | System 6, Apple menu and scrap book |
System 7.5.3, Desktop | System 7.5.3, Apple menu with control panel | System 7.5.3, system directory and info | System 7.5.3, file menu and system directory |
System 7.5.3, help with text balloons | System 7.5.3, find file | Mac OS 7.6.1, system is starting | Mac OS 7.6.1, desktop and system directory |
Mac OS 9, system is starting | Mac OS 9, desktop and version | Mac OS 9, iCab internet browser | Mac OS 9, Apple menu with system directory |
Mac OS 9, control panel | Mac OS 9, system partition | Mac OS 9, Sherlock 2 | Mac OS 9, context menu and alias |
Desktop of Mac OS 8.1 | Desktop of Mac OS 10 | Mac OS 10.3 - Boot logo | Mac OS 10.3 - Installation screen |
Language selection | Mac OS X installer | Storage drive for installation | Installation type for custom install |
Boot screen of Mac OS X | Desktop with user directory | About this mac | System Preferences |
Safari Internet Browser | Software Update | Applications | Unix bash terminal |
Internet Explorer 5.2 for Mac |
Versions
1985 - System 2.0, updates and improvements like the Finder and menu
1986 - System 3.0, contains optimizations, first time with HFS file system
1987 - System 4.0, bug fixes
1987 - System 4.1, improved Finder (supports HDD >32 mbyte)
1988 - System 6, 32-bit color, Quickdraw support, serial port driver support, Truetype fonts
1990 - System 7, 32-bit memory adressing on supported hardware, first time with virtual memory, updated GUI
1994 - System 7.5
1997 - Mac OS 7.6
1997 - Mac OS 8.0
1998 - Mac OS 8.1, 32-Bit, file system HFS+, only limited memory protection, USB and Firewire on supported hardware
1998 - Mac OS 8.5.1, Sherlock search files on hard disks and on the internet, intranet updates
1999 - Mac OS 8.6, multi-processor capable
1999 - Mac OS 9 (sonata), Sherlock 2 can handle files with size up to 2 tbyte, user profiles (multiple users)
2001 - Mac OS 9.1
1999 - Mac OS X Server, Mach- Kernel 2.5 (Unix-derivated microkernel) better performance and stability
1999 March - Mac OS X Server 1.0
2000 - Mac OS X Server 1.2.3
2001 March - Mac OS X 10.0 (Cheetah)
2001 Sept. - Mac OS X 10.1 (Puma), improved performance, improved GUI
2002 Aug. - Mac OS X 10.2 (Jaguar), new applications and technology
2003 Oct. - Mac OS X 10.3 (Panther), new features for improved productivity and security; Mac OS X Server 10.3
2005 April - Mac OS X 10.4 (Tiger), new technology; Mac OS X Server 10.4
2006 Jan. - Mac OS X 10.4.4, first also available vor intel based syystems
2007 Oct. - Mac OS X 10.5 (Leopard)
2009 Sept. - Mac OS X 10.6 (Snow Leopard), only for x86-64 Bit Intel dualcore
2016 Sept. - macOS 10.12 (Sierra) available, introducing Apple File System (APFS)
Efficient memory management is an important aspect of writing high performance code in both OS X and iOS. Minimizing memory usage not only decreases your application’s memory footprint, it can also reduce the amount of CPU time it consumes. In order to properly tune your code though, you need to understand something about how the underlying system manages memory.
Both OS X and iOS include a fully-integrated virtual memory system that you cannot turn off; it is always on. Both systems also provide up to 4 gigabytes of addressable space per 32-bit process. In addition, OS X provides approximately 18 exabytes of addressable space for 64-bit processes. Even for computers that have 4 or more gigabytes of RAM available, the system rarely dedicates this much RAM to a single process.
To give processes access to their entire 4 gigabyte or 18 exabyte address space, OS X uses the hard disk to hold data that is not currently in use. As memory gets full, sections of memory that are not being used are written to disk to make room for data that is needed now. The portion of the disk that stores the unused data is known as the backing store because it provides the backup storage for main memory.
Although OS X supports a backing store, iOS does not. In iPhone applications, read-only data that is already on the disk (such as code pages) is simply removed from memory and reloaded from disk as needed. Writable data is never removed from memory by the operating system. Instead, if the amount of free memory drops below a certain threshold, the system asks the running applications to free up memory voluntarily to make room for new data. Applications that fail to free up enough memory are terminated.
Note: Unlike most UNIX-based operating systems, OS X does not use a preallocated disk partition for the backing store. Instead, it uses all of the available space on the machine’s boot partition.
The following sections introduce terminology and provide a brief overview of the virtual memory system used in both OS X and iOS. For more detailed information on how the virtual memory system works, see Kernel Programming Guide.
About Virtual Memory
Virtual memory allows an operating system to escape the limitations of physical RAM. The virtual memory manager creates a logical address space (or “virtual” address space) for each process and divides it up into uniformly-sized chunks of memory called pages. The processor and its memory management unit (MMU) maintain a page table to map pages in the program’s logical address space to hardware addresses in the computer’s RAM. When a program’s code accesses an address in memory, the MMU uses the page table to translate the specified logical address into the actual hardware memory address. This translation occurs automatically and is transparent to the running application.
As far as a program is concerned, addresses in its logical address space are always available. However, if an application accesses an address on a memory page that is not currently in physical RAM, a page fault occurs. When that happens, the virtual memory system invokes a special page-fault handler to respond to the fault immediately. The page-fault handler stops the currently executing code, locates a free page of physical memory, loads the page containing the needed data from disk, updates the page table, and then returns control to the program’s code, which can then access the memory address normally. This process is known as paging.
If there are no free pages available in physical memory, the handler must first release an existing page to make room for the new page. How the system release pages depends on the platform. In OS X, the virtual memory system often writes pages to the backing store. The backing store is a disk-based repository containing a copy of the memory pages used by a given process. Moving data from physical memory to the backing store is called paging out (or “swapping out”); moving data from the backing store back in to physical memory is called paging in (or “swapping in”). In iOS, there is no backing store and so pages are are never paged out to disk, but read-only pages are still be paged in from disk as needed.
In OS X and in earlier versions of iOS, the size of a page is 4 kilobytes. In later versions of iOS, A7- and A8-based systems expose 16-kilobyte pages to the 64-bit userspace backed by 4-kilobyte physical pages, while A9 systems expose 16-kilobyte pages backed by 16-kilobyte physical pages. These sizes determine how many kilobytes the system reads from disk when a page fault occurs. Disk thrashing can occur when the system spends a disproportionate amount of time handling page faults and reading and writing pages, rather than executing code for a program.
Paging of any kind, and disk thrashing in particular, affects performance negatively because it forces the system to spend a lot of time reading and writing to disk. Reading a page in from the backing store takes a significant amount of time and is much slower than reading directly from RAM. If the system has to write a page to disk before it can read another page from disk, the performance impact is even worse.
Details of the Virtual Memory System
The logical address space of a process consists of mapped regions of memory. Each mapped memory region contains a known number of virtual memory pages. Each region has specific attributes controlling such things as inheritance (portions of the region may be mapped from “parent” regions), write-protection, and whether it is wired (that is, it cannot be paged out). Because regions contain a known number of pages, they are page-aligned, meaning the starting address of the region is also the starting address of a page and the ending address also defines the end of a page.
The kernel associates a VM object with each region of the logical address space. The kernel uses VM objects to track and manage the resident and nonresident pages of the associated regions. A region can map to part of the backing store or to a memory-mapped file in the file system. Each VM object contains a map that associates regions with either the default pager or the vnode pager. The default pager is a system manager that manages the nonresident virtual memory pages in the backing store and fetches those pages when requested. The vnode pager implements memory-mapped file access. The vnode pager uses the paging mechanism to provide a window directly into a file. This mechanism lets you read and write portions of the file as if they were located in memory.
In addition to mapping regions to either the default or vnode pager, a VM object may also map regions to another VM object. The kernel uses this self referencing technique to implement copy-on-write regions. Copy-on-write regions allow different processes (or multiple blocks of code within a process) to share a page as long as none of them write to that page. When a process attempts to write to the page, a copy of the page is created in the logical address space of the process doing the writing. From that point forward, the writing process maintains its own separate copy of the page, which it can write to at any time. Copy-on-write regions let the system share large quantities of data efficiently in memory while still letting processes manipulate those pages directly (and safely) if needed. These types of regions are most commonly used for the data pages loaded from system frameworks.
Each VM object contains several fields, as shown in Table 1.
Field | Description |
---|---|
Resident pages | A list of the pages of this region that are currently resident in physical memory. |
Size | The size of the region, in bytes. |
Pager | The pager responsible for tracking and handling the pages of this region in backing store. |
Shadow | Used for copy-on-write optimizations. |
Copy | Used for copy-on-write optimizations. |
Attributes | Flags indicating the state of various implementation details. |
If the VM object is involved in a copy-on-write (vm_copy
) operation, the shadow and copy fields may point to other VM objects. Otherwise both fields are usually NULL
.
Wired Memory
Wired memory (also called resident memory) stores kernel code and data structures that must never be paged out to disk. Applications, frameworks, and other user-level software cannot allocate wired memory. However, they can affect how much wired memory exists at any time. For example, an application that creates threads and ports implicitly allocates wired memory for the required kernel resources that are associated with them.
Table 2 lists some of the wired-memory costs for application-generated entities.
Resource | Wired Memory Used by Kernel |
---|---|
Process | 16 kilobytes |
Thread | blocked in a continuation—5 kilobytes; blocked—21 kilobytes |
Mach port | 116 bytes |
Mapping | 32 bytes |
Library | 2 kilobytes plus 200 bytes for each task that uses it |
Memory region | 160 bytes |
Note: These measurements may change with each new release of the operating system. They are provided here to give you a rough estimate of the relative cost of system resource usage.
As you can see, every thread, process, and library contributes to the resident footprint of the system. In addition to your application using wired memory, however, the kernel itself requires wired memory for the following entities:
VM objects
the virtual memory buffer cache
I/O buffer caches
drivers
Wired data structures are also associated with the physical page and map tables used to store virtual-memory mapping information, Both of these entities scale with the amount of available physical memory. Consequently, when you add memory to a system, the amount of wired memory increases even if nothing else changes. When a computer is first booted into the Finder, with no other applications running, wired memory can consume approximately 14 megabytes of a 64 megabyte system and 17 megabytes of a 128 megabyte system.
Wired memory pages are not immediately moved back to the free list when they become invalid. Instead they are “garbage collected” when the free-page count falls below the threshold that triggers page out events.
Page Lists in the Kernel
The kernel maintains and queries three system-wide lists of physical memory pages:
The active list contains pages that are currently mapped into memory and have been recently accessed.
The inactive list contains pages that are currently resident in physical memory but have not been accessed recently. These pages contain valid data but may be removed from memory at any time.
The free list contains pages of physical memory that are not associated with any address space of VM object. These pages are available for immediate use by any process that needs them.
When the number of pages on the free list falls below a threshold (determined by the size of physical memory), the pager attempts to balance the queues. It does this by pulling pages from the inactive list. If a page has been accessed recently, it is reactivated and placed on the end of the active list. In OS X, if an inactive page contains data that has not been written to the backing store recently, its contents must be paged out to disk before it can be placed on the free list. (In iOS, modified but inactive pages must remain in memory and be cleaned up by the application that owns them.) If an inactive page has not been modified and is not permanently resident (wired), it is stolen (any current virtual mappings to it are destroyed) and added to the free list. Once the free list size exceeds the target threshold, the pager rests.
The kernel moves pages from the active list to the inactive list if they are not accessed; it moves pages from the inactive list to the active list on a soft fault (see Paging In Process). When virtual pages are swapped out, the associated physical pages are placed in the free list. Also, when processes explicitly free memory, the kernel moves the affected pages to the free list.
Paging Out Process
In OS X, when the number of pages in the free list dips below a computed threshold, the kernel reclaims physical pages for the free list by swapping inactive pages out of memory. To do this, the kernel iterates all resident pages in the active and inactive lists, performing the following steps:
If a page in the active list is not recently touched, it is moved to the inactive list.
If a page in the inactive list is not recently touched, the kernel finds the page’s VM object.
If the VM object has never been paged before, the kernel calls an initialization routine that creates and assigns a default pager object.
The VM object’s default pager attempts to write the page out to the backing store.
If the pager succeeds, the kernel frees the physical memory occupied by the page and moves the page from the inactive to the free list.
Note: In iOS, the kernel does not write pages out to a backing store. When the amount of free memory dips below the computed threshold, the kernel flushes pages that are inactive and unmodified and may also ask the running application to free up memory directly. For more information on responding to these notifications, see Responding to Low-Memory Warnings in iOS.
Paging In Process
The final phase of virtual memory management moves pages into physical memory, either from the backing store or from the file containing the page data. A memory access fault initiates the page-in process. A memory access fault occurs when code tries to access data at a virtual address that is not mapped to physical memory. There are two kinds of faults:
A soft fault occurs when the page of the referenced address is resident in physical memory but is currently not mapped into the address space of this process.
A hard fault occurs when the page of the referenced address is not in physical memory but is swapped out to backing store (or is available from a mapped file). This is what is typically known as a page fault.
When any type of fault occurs, the kernel locates the map entry and VM object for the accessed region. The kernel then goes through the VM object’s list of resident pages. If the desired page is in the list of resident pages, the kernel generates a soft fault. If the page is not in the list of resident pages, it generates a hard fault.
For soft faults, the kernel maps the physical memory containing the pages to the virtual address space of the process. The kernel then marks the specific page as active. If the fault involved a write operation, the page is also marked as modified so that it will be written to backing store if it needs to be freed later.
For hard faults, the VM object’s pager finds the page in the backing store or from the file on disk, depending on the type of pager. After making the appropriate adjustments to the map information, the pager moves the page into physical memory and places the page on the active list. As with a soft fault, if the fault involved a write operation, the page is marked as modified.
Copyright © 2003, 2013 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2013-04-23