词条 | Out of memory |
释义 |
}} Out of memory (OOM) is an often undesired state of computer operation where no additional memory can be allocated for use by programs or the operating system. Such a system will be unable to load any additional programs, and since many programs may load additional data into memory during execution, these will cease to function correctly. This usually occurs because all available memory, including disk swap space, has been allocated. HistoryHistorically, the out of memory condition was more common than it is now, since early computers and operating systems were limited to small amounts of physical random-access memory (RAM) due to the inability of early processors to address large amounts of memory, as well as cost considerations. Since the advent of virtual memory opened the door for the usage of swap space, the condition is less frequent. Almost all modern programs expect to be able to allocate and deallocate memory freely at run-time, and tend to fail in uncontrolled ways (crash) when that expectation is not met; older ones often allocated memory only once, checked whether they got enough to do all their work, and then expected no more to be forthcoming. Therefore, they would either fail immediately with an "out of memory" error message, or work as expected.{{Citation needed|date=July 2010}} Early operating systems such as MS-DOS lacked support for multitasking. Programs were allocated physical memory that they could use as they needed. Physical memory was often a scarce resource, and when it was exhausted by applications such as those with Terminate and Stay Resident functionality, no further applications could be started until running applications were closed. Modern operating systems provide virtual memory, in which processes are given a range of memory, but where the memory does not directly correspond to actual physical RAM. Virtual memory can be backed by physical RAM, a disk file via mmap, or swap space, and the operating system can move virtual memory pages around as it needs. Because virtual memory does not need to be backed by physical memory, exhaustion of it is rare, and usually there are other limits imposed by the operating system on resource consumption.{{Citation needed|date=December 2014}} As predicted by Moore's law, the amount of physical memory in all computers has grown almost exponentially, although this is offset to some degree by programs and files themselves becoming larger. In some cases, a computer with virtual memory support where the majority of the loaded data resides on the hard disk may run out of physical memory but not virtual memory, thus causing excessive paging. This condition, known as thrashing, usually renders the computer unusable until some programs are closed or the machine is rebooted. Due to these reasons, an out of memory message is rarely encountered by applications with modern computers.{{Citation needed|date=December 2014}} It is, however, still possible to encounter an OOM condition with a modern computer. The typical OOM case in modern computers happens when the operating system is unable to create any more virtual memory, because all of its potential backing devices have been filled or the end-user has disabled them. Out of memory managementThe kernels of operating systems such as Linux will attempt to recover from this type of OOM condition by terminating one or more processes, a mechanism known as the OOM Killer.[1] Linux 4.6 (released in May 2016) introduced changes in OOM situations, improving detection and reliability.[2][3], cgroup awareness in OOM killer was implemented in Linux Kernel 4.19 released in October 2018, which adds an ability to kill a cgroup as a single unit [4]. Per-process memory limitsApart from the system-wide physical memory limits, some systems limit the amount of memory each process can use. Usually a matter of policy, such a limitation can also happen when the OS has a larger address space than is available at the process level. Some high-end 32-bit systems (such as those with Physical Address Extension enabled) come with 8 gigabytes or more of system memory, even though any single process can only access 4GB of it in a 32-bit flat memory model. A process which exceeds its per-process limit and then attempts to allocate further memory will encounter an error condition. For example, the C standard function for allocating memory, References1. ^{{cite web|title= How to Configure the Linux Out-of-Memory Killer|url= http://www.oracle.com/technetwork/articles/servers-storage-dev/oom-killer-1911807.html|accessdate= 19 February 2015}} 2. ^https://lwn.net/Articles/668126/#reaper/ 3. ^https://kernelnewbies.org/Linux_4.6#head-e876eaf1c8288d0bb28744e5319a833e9f031538 4. ^https://kernelnewbies.org/Linux_4.19#Memory_management External links
2 : Memory management|Computer errors messages |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。