snmpd is using excessive amount of memory after upgrade

Solution Verified - Updated -

Issue

  • The snmpd daemon is using an excessive amount of memory after upgrade to net-snmp-5.7.2-38.el7_6.2 or later. Increased usage of swap space may be observed and in some situations the snmpd daemon might invoke the kernel oom-killer.
  • High memory usage of snmpd is observed when SNMP protocol version 3 (SNMPv3) is used for interaction with the daemon.
  • Messages similar to the following may be seen in the logs (some lines were omitted):

    Oct  4 08:12:54 example-host snmpd[<pid>]: fork: Cannot allocate memory
    
    Oct  4 08:15:45 example-host kernel: snmpd invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
    Oct  4 08:15:45 example-host kernel: snmpd cpuset=/ mems_allowed=0
    Oct  4 08:15:45 example-host kernel: CPU: 1 PID: <pid> Comm: snmpd Kdump: loaded Not tainted 3.10.0-1062.el7.x86_64 #1
    Oct  4 08:15:45 example-host kernel:  [<ffffffff991bfd74>] oom_kill_process+0x254/0x3e0
    Oct  4 08:15:45 example-host kernel: [ <pid>]     0  <pid>  1263624   179812    2421  1026961             0 snmpd
    Oct  4 08:15:45 example-host kernel: Out of memory: Kill process <pid> (snmpd) score 515 or sacrifice child
    Oct  4 08:15:45 example-host kernel: Killed process <pid> (snmpd), UID 0, total-vm:5054496kB, anon-rss:719248kB, file-rss:0kB, shmem-rss:0kB
    Oct  4 08:15:45 example-host systemd[1]: snmpd.service: main process exited, code=killed, status=9/KILL
    Oct  4 08:15:45 example-host systemd[1]: Unit snmpd.service entered failed state.
    Oct  4 08:15:45 example-host systemd[1]: snmpd.service failed.
    

Environment

  • Red Hat Enterprise Linux 7.6
  • Red Hat Enterprise Linux 7.7
  • net-snmp-5.7.2-38.el7_6.2 or later

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In