Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Out of Memory errors

Discussion in 'General Discussion' started by brianc, Mar 5, 2018.

  1. brianc

    brianc Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    168
    We have upgraded our servers to have more memory and CPUs. However we now receive more OOM alerts from cPanel than ever before. Here is the latest one:

    In order to avoid a system crash due to low memory, the kernel terminated the process named “java” with the PID “11431”.

    Status

    Out of Memory ⚠

    Memory Information

    Used

    2.15 GB

    Available

    9.43 GB

    Installed

    11.58 GB


    Since these OOM alerts come from cPanel's processes, I changed the "Max cPanel process memory" setting in Tweak settings to unlimited. It does not have any effect. What am I missing here?

    Thanks,
    Brian
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. brianc

    brianc Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    168
    It does not. The server was running fine at the time of these OOM warnings. Also there was plenty of memory left. So I am confused. How does one get an OOM warning when 9+ GB of memory unused? This is what the messages log says:

    Mar 5 06:34:58 host2 kernel: Out of memory: Kill process 11585 (clamd) score 40 or sacrifice child
    Mar 5 06:35:01 host2 kernel: [<ffffffff81188ab6>] out_of_memory+0x4b6/0x4f0
    Mar 5 06:35:01 host2 kernel: Out of memory: Kill process 10338 (mysqld) score 35 or sacrifice child
    Mar 5 06:35:01 host2 kernel: [<ffffffff81188ab6>] out_of_memory+0x4b6/0x4f0
    Mar 5 06:35:01 host2 kernel: Out of memory: Kill process 11414 (java) score 34 or sacrifice child
    Mar 5 06:35:01 host2 kernel: [<ffffffff81188ab6>] out_of_memory+0x4b6/0x4f0
    Mar 5 06:35:01 host2 kernel: Out of memory: Kill process 11431 (java) score 34 or sacrifice child

    Are these not cPanel processes?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,864
    Likes Received:
    89
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    What I suspect it is that this may be related to the SWAP. Did you check what was the swap space left when this incident occur.. What is the swap value? Execute the below command to check for it.

    # cat /proc/sys/vm/swappiness -> Swap space value.
    # free -m -> memory and swap usage..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. brianc

    brianc Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    168
    cat /proc/sys/vm/swappiness = 30
    free -m =
    total used free shared buff/cache available
    Mem: 11854 2551 697 329 8605 8553
    Swap: 511 398 113

    The swap size configured for the server is 512mb. Too low?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Brian,

    Keep in mind the OOM killer is not a feature of cPanel & WHM, and is unrelated to the "Max cPanel process memory" setting you referenced. cPanel simply sends the notification to let you know your system's OOM killer was invoked because the "System Out of Memory" notification type is enabled in "WHM >> Contact Manager".

    The following document is useful for understanding how the OOM Killer works:

    OOM Killer - linux-mm.org Wiki

    You may also find this URL helpful:

    How to diagnose causes of oom-killer killing processes

    If you're using CentOS 7, information about the killed process is logged via journalctl. EX:

    Code:
    journalctl -r | grep memory
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice