• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS/RHEL 6 Kernel Panic – “Out of memory” kernel parameter panic_on_oom is enabled

by admin

The Problem

CentOS/RHEL 6 system reboot due too out of memory error:

DUMPFILE: vmcore [PARTIAL DUMP]
  CPUS: 2
  DATE: Mon Feb 29 05:28:02 2016
  UPTIME: 33 days, 09:45:55
LOAD AVERAGE: 1.88, 1.52, 1.41
  TASKS: 218
  NODENAME: localhost
  RELEASE: 2.6.32-431.el6.x86_64
  VERSION: #1 SMP Sun Nov 10 22:19:54 EST 2013
  MACHINE: x86_64 (3000 Mhz)
  MEMORY: 8 GB
  PANIC: "Kernel panic - not syncing: Out of memory: system-wide panic_on_oom is enabled"
  PID: 31010
  COMMAND: "java"
  TASK: ffff88010055a040 [THREAD_INFO: ffff88001583e000]
  CPU: 0
  STATE: TASK_RUNNING (PANIC)

The Solution

Reboot is due to:
1. the OOM killer and the physical/swap memory is completely utilized.
2. vm.panic_on_oom was enabled.

>kmem -i

PAGES TOTAL PERCENTAGE
TOTAL MEM 1979578 7.6 GB ----
FREE 27818 108.7 MB 1% of TOTAL MEM
USED 1951760 7.4 GB 98% of TOTAL MEM   98% memory used
SHARED 270 1.1 MB 0% of TOTAL MEM
BUFFERS 53 212 KB 0% of TOTAL MEM
CACHED 1461 5.7 MB 0% of TOTAL MEM
SLAB 14026 54.8 MB 0% of TOTAL MEM

TOTAL SWAP 4196348 16 GB ----
SWAP USED 4196347 16 GB 99% of TOTAL SWAP
SWAP FREE 1 4 KB 0% of TOTAL SWAP      No free swap space

COMMIT LIMIT 5186137 19.8 GB ----
COMMITTED 1564979 6 GB 30% of TOTAL LIMIT
# sysctl_-a |grep vm.panic_on_oom
 vm.panic_on_oom = 1                 OOM enabled for panic.

In this example, “java” process consumed 80% of the memory.

>ps
..
30934 1 1 ffff88010043aae0 IN 78.3 29303436 7384984 java
30935 1 1 ffff88010043b540 IN 78.3 29303436 7384984 java
30936 1 1 ffff880238f62080 IN 78.3 29303436 7384984 java
31008 1 1 ffff8801060b0aa0 IN 78.3 29303436 7384984 java
31009 1 1 ffff8801060b0040 IN 78.3 29303436 7384984 java
> 31010 1 0 ffff88010055a040 RU 78.3 29303436 7384984 java
31690 1 0 ffff880239fc6aa0 IN 78.3 29303436 7384984 java
...

Physical memory or swap memory has to be increased to avoid OOM, else the memory usage of application has to be reduced. The application memory usage can be limit via ulimit or cgroup.

Filed Under: CentOS/RHEL 6, Linux

Some more articles you might also be interested in …

  1. What is the purpose of “wheel” group in Linux
  2. parted: command not found
  3. localectl Command Examples in Linux
  4. CentOS/RHEL – How to Remove stale ISCSI Target Node Information from ISCSI Initiator Server
  5. How to truncate /var/log/lastlog File
  6. Understanding The /etc/sysconfig Directory
  7. net-snmp-create-v3-user: command not found
  8. startkde: command not found
  9. bpftool: command not found
  10. Beginners Guide to Samba (Installation and Configuration)

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright