(轉貼)Out of Memory: Killed process
如果/VAR/LOG/MESSAGE中出現了上面的錯誤,那就是因為某些程式因為記憶體不夠而被系統自動殺掉了,系統自動殺掉某些程式主要是出於對系統整體的保護,避免整個系統HANG掉。
下面轉載的文章中詳細描述了這種問題發生的原因和避免的辦法
[@more@]Since this problem seems to popup on different lists, this message has been cross-posted to the general Red Hat discussion list, the RHEL3 (Taroon) list and the RHEL4 (Nahant) list. My apologies for not having the time to post this summary sooner. I would still be banging my head against this problem were it not for the generous assistance of Tom Sightlerand Brian Long . In general, the out of memory killer (oom-killer) begins killing processes, even on servers with large amounts (6Gb+) of RAM. In many cases people report plenty of "free" RAM and are perplexed as to why the oom-killer is whacking processes. Indications that this has happened appear in /var/log/messages: Out of Memory: Killed process [PID] [process name]. In my case I was upgrading various VMware servers from RHEL3 / VMware GSX to RHEL4 / VMware Server. One of the virtual machines on a server with 16Gb of RAM kept getting whacked by the oom-killer. Needless to say, this was quite frustrating. As it turns out, the problem was low memory exhaustion. Quoting Tom: "The kernel uses low memory to track allocations of all memory thus a system with 16GB of memory will use significantly more low memory than a system with 4GB, perhaps as much as 4 times. This extra pressure happens from the moment you turn the system on before you do anything at all because the kernel structures have to be sized for the potential of tracking allocations in four times as much memory." You can check the status of low & high memory a couple of ways: # egrep 'High|Low' /proc/meminfo HighTotal: 5111780 kB HighFree: 1172 kB LowTotal: 795688 kB LowFree: 16788 kB # free -lm total used free shared buffers cached Mem: 5769 5751 17 0 8 5267 Low: 777 760 16 0 0 0 High: 4991 4990 1 0 0 0 -/+ buffers/cache: 475 5293 Swap: 4773 0 4773 When low memory is exhausted, it doesn't matter how much high memory is available, the oom-killer will begin whacking processes to keep the server alive. There are a couple of solutions to this problem: If possible, upgrade to 64-bit Linux. This is the best solution because *all* memory becomes low memory. If you run out of low memory in this case, then you're *really* out of memory. ;-) If limited to 32-bit Linux, the best solution is to run the hugemem kernel. This kernel splits low/high memory differently, and in most cases should provide enough low memory to map high memory. In most cases this is an easy fix - simply install the hugemem kernel RPM & reboot. If running the 32-bit hugemem kernel isn't an option either, you can try setting /proc/sys/vm/lower_zone_protection to a value of 250 or more. This will cause the kernel to try to be more aggressive in defending the low zone from allocating memory that could potentially be allocated in the high memory zone. As far as I know, this option isn't available until the 2.6.x kernel. Some experimentation to find the best setting for your environment will probably be necessary. You can check & set this value on the fly via: # cat /proc/sys/vm/lower_zone_protection # echo "250" > /proc/sys/vm/lower_zone_protection To set this option on boot, add the following to /etc/sysctl.conf: vm.lower_zone_protection = 250 As a last-ditch effort, you can disable the oom-killer. This option can cause the server to hang, so use it with extreme caution (and at your own risk)! Check status of oom-killer: # cat /proc/sys/vm/oom-kill Turn oom-killer off/on: # echo "0" > /proc/sys/vm/oom-kill # echo "1" > /proc/sys/vm/oom-kill To make this change take effect at boot time, add the following to /etc/sysctl.conf: vm.oom-kill = 0 For processes that would have been killed, but weren't because the oom- killer is disabled, you'll see the following message in /var/log/messages: "Would have oom-killed but /proc/sys/vm/oom-kill is disabled" Sorry for being so long-winded. I hope this helps others who have struggled with this problem.
總結一下:
1、這樣的問題一般出在32位系統,因為64位系統上所有的記憶體都當作LOWER MEMORY了,所以如果出現這樣的問題,那就是記憶體真的不夠了。
2、可以關閉OOM-KILLER來避免這樣的報錯,不過這樣更危險
3、32位系統上,可以透過設定核心引數來調高LOWER MEMORY的值,避免這樣的報錯發生(其實也不是完全避免,只是把報錯的門檻提高了一點)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25016/viewspace-1004687/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-04030: out of process memory ...(initSubHeap:qk...)的錯誤解決
- OOM(Out Of Memory)OOM
- OOM(Out Of Memory)是什麼?OOM
- ES叢集搭建問題:memory locking requested for elasticsearch process but memory is not lockedElasticsearch
- Oracle記憶體結構(三)----Process Memory的詳細資訊(轉)Oracle記憶體
- 完蛋!我被 Out of Memory 包圍了!
- PostgreSQL DBA(95) - PG 12 Partition(out of shared memory)SQL
- 【ERROR】ORA-27102: out of memory 解決方法Error
- git post資料過大報錯-Out of memoryGit
- iOS Out-Of-Memory 原理闡述及方案調研iOS
- 解決Android 虛擬機器執行The emulator process for AVD was killed.錯誤。Android虛擬機
- Composer 記憶體不足解決方案 PHP Fatal error: Out of memory記憶體PHPError
- 由node的批量requests引起的”heap out of memory”解決方案
- [轉帖]Native Memory Tracker
- Out of sort memory, consider increasing server sort buffer size的兩種情況IDEServer
- Java Out Of Memory解決之JAVA_OPTS引數說明與配置Java
- Win10系統玩cf出現out of memory的解決方法Win10
- android studio Error:Unable to start the daemon process【轉】AndroidError
- [轉帖]10 Tips for using the Eclipse Memory AnalyzerEclipse
- Javascript記憶體溢位,FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memoryJavaScript記憶體溢位ErrorASTAI
- 啟動Oracle報錯ORA-27102: out of memory、Linux-x86_64 Error: 28: No space leftOracleLinuxError
- [20200319]KILL STATUS ='KILLED'的程式.txt
- 解決yarn打包時出現“FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory”的問題YarnErrorMITAIJavaScript
- Android 棧記憶體溢位bug fix小記(pthread_create (1040KB stack) failed: Out of memory)Android記憶體溢位threadAI
- Linux下Python程式Killed,分析其原因LinuxPython
- memory
- 【node】process
- vi編輯器開啟大檔案報錯0602-101 Out of memory saving lines for undo的解決方法
- idea無法黏貼_IntelliJ Idea 複製貼上的問題(轉載)IdeaIntelliJ
- [轉貼][php擴充套件-amqp]安裝PHP套件MQ
- BMZCTF:memory
- find process by port
- Kotlin 1.2.50 is out!Kotlin
- [Memory Leak] 1. console.log cause memory leak
- VM warning: INFO: OS::commit_memory Cannot allocate memoryMIT
- Java中使用POI讀取大的Excel檔案或者輸入流時發生out of memory異常參考解決方案JavaExcel
- RuntimeError: An attempt has been made to start a new process before the current process hasError
- [Symfony Component Process Exception RuntimeException] The Process class relies on proc_open, whichException