An error message indicates that the memory is insufficient and cannot be allocated. Check that the physical machine memory is used normally. After modifying the virtual machine memory, an error message is still reported when starting
report errors:
At this time, you need to see how much memory the host can allocate
sysctl -a | grep overcommit
Kernel parameter overcommit_ memory
It is Memory allocation strategy
Optional values: 0, 1, 2
0 indicates that the kernel will check whether there is enough available memory for processes to use; If there is enough available memory, the memory application is allowed; Otherwise, the memory request fails and the error is returned to the application process
1 indicates that the kernel is allowed to allocate all physical memory regardless of the current memory state
2 indicates that the kernel allows to allocate more memory than the sum of all physical memory and swap space
What are overcommit and oom
Linux replies “yes” to most requests for memory so that it can run more and larger programs. Because after applying for memory, memory will not be used immediately. This technology is called overcommit. When Linux finds that there is insufficient memory, an oom killer (OOM = out of memory) occurs. It will choose to kill some processes (user state processes, not kernel threads) to free memory.
When oom killer happens, which processes will Linux choose to kill?The function to select a process is oom_ Badness function (in mm/oom_kill. C), which calculates the number of points (0 ~ 1000) for each process. The higher the number of points, the more likely the process is to be killed. The number of points per process is the same as oom_ score_ Adj related, and OOM_ score_ Adj can be set (- 1000 min, 1000 max).
resolvent:
Simply follow the prompts (set vm.overcommit_memory to 1):
There are three ways to modify kernel parameters, but with root permission:
(1) Edit/etc/sysctl.conf to vm.overcommit_ Memory = 1, then sysctl – P makes the configuration file effective
(2)sysctl vm.overcommit_ memory=1
(3)echo 1 >/proc/sys/vm/overcommit_ memory
Read More:
- CentOS execution command error: – bash: fork: cannot allocate memory processing / viewing process number
- os::commit_memory(0x0000000538000000, 11408506880, 0) failed; error=‘Cannot allocate memory‘
- Swap off failed: cannot allocate memory
- WebHost failed to process a request.Memory gates checking failed because the free memory (140656640 …
- RuntimeError: CUDA out of memory. Tried to allocate 600.00 MiB (GPU 0; 23.69 GiB total capacity)
- Fatal error: Newspace:: rebalance allocation failed – process out of memory (memory overflow)
- Mysql cannot allocate memory for the buffer pool solution
- Remember a virtual machine expansion swapoff failed: cannot allocate memory
- [Solved] Android compile error: cannot allocate memory
- Hbase Native memory allocation (mmap) failed to map xxx bytes for committing reserved memory
- The docker installation es reported an error of failed; error = – cannot allocate memory ‘(errno = 12)
- Server composer install error: proc_open(): fork failed-Cannot allocate memory
- The difference, cause and solution of memory overflow and memory leak
- Oracle 11g installation prompt ora-27102: out of memory
- [Solved] Memory analysis tool Start Error: An internal error occurred during: “Parsing heap dump from
- VBoxClient (seamless): failed to start. Stage: Setting guest IRQ filter mas Error: VERR_INTERNAL_ERR
- Error: 701 use DAC connection when out of memory
- [PostgreSQL tutorial] · out of memory issue
- Opencv error: insufficient memory
- Memory leak in Windows 8.1 with Killer E2200 and Windows Network Data Usage Monitoring