进入正题前先说明:OOM killer什么时候出现?

linux下允许程序申请比系统可用内存更多的内存,这个特性叫Overcommit。这样做是出于优化系统考虑,因为不是所有的程序申请了内存就立刻使用的,当你使用的时候说不定系统已经回收了一些资源了。不幸的是,当你用到这个Overcommit给你的内存的时候,系统还没有资源的话,OOM killer就跳出来了

今天外网某个游戏服无法登陆,查到mysqld进程不在了,于是查系统日志(/var/log/message)如下:

----------------------------------------------系统日志----开始---------------------------------------------

Apr 13 04:00:59 localhost kernel: Out of memory: Kill process 6033 (mysqld) score 85 or sacrifice child
Apr 13 04:00:59 localhost kernel: Killed process 6033, UID 498, (mysqld) total-vm:56872260kB, anon-rss:3202560kB, file-rss:40kB
Apr 13 09:28:37 localhost auditd[1979]: Audit daemon rotating log files

----------------------------------------------系统日志----结束---------------------------------------------

我的内存是64G,一般运行游戏服的90个进程是没问题的,而且内存还剩12个G,今天突然被OOM 杀掉,于是查了系统日志,发现 syslog-ng在作怪,日志如下:

--------------------------------syslog-ng--------------系统日志----开始---------------------------------------------

Apr 13 03:32:16 localhost kernel: syslog-ng[178936]: segfault at c06000 ip 00007f77c269a820 sp 00007f77b61f9390 error 4 in libsyslog-ng-3.6.so.0.0.0[7f77c2642000+9b000]
Apr 13 03:32:16 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'
Apr 13 03:32:19 localhost kernel: syslog-ng[178944]: segfault at c06000 ip 00007f77c269a820 sp 00007f77bca5c390 error 4 in libsyslog-ng-3.6.so.0.0.0[7f77c2642000+9b000]
Apr 13 03:32:19 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'
Apr 13 03:32:32 localhost kernel: syslog-ng[178960]: segfault at c0cbb0 ip 00007f77c0e4d9df sp 00007f77b6bfa2f8 error 4 in libc-2.12.so[7f77c0d1a000+18b000]
Apr 13 03:32:32 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'
Apr 13 03:32:44 localhost kernel: syslog-ng[178973]: segfault at c06370 ip 00007f77c0e4d9df sp 00007f77bca5c2f8 error 4 in libc-2.12.so[7f77c0d1a000+18b000]
Apr 13 03:32:45 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'
Apr 13 03:33:02 localhost kernel: syslog-ng[178997]: segfault at c06050 ip 00007f77c0e4d9df sp 00007f779bffc2f8 error 4 in libc-2.12.so[7f77c0d1a000+18b000]
Apr 13 03:33:02 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'

--------------------------------syslog-ng--------------系统日志----结束---------------------------------------------

syslog-ng 一直  restarting。所以猜测是syslog-ng内存占用过大,正好mysql要使用之前申请的系统内存时,而此时系统并没有资源,就被无情KILL了。

total -vm:个人理解是当前占用的虚拟内存。

以上是个人碰到问题收集,如果各路大神觉得有问题,记得给我留言纠正,生命不息,奋斗不止。

Out of memory: Kill process 6033 (mysqld) score 85 or sacrifice child的更多相关文章

  1. Out of memory: Kill process 25280 (php-fpm) score 86 or sacrifice child

    php-fpm 耗尽服务器内存的办法 java服务今天突然宕机,通过 cat /var/log/messages进行查看,发现是系统内存溢出导致系统把java的进程杀掉了 使用top查看系统内存使用情 ...

  2. 理解和配置Out of memory: Kill process

    转自:爱开源 理解 OOM killer 最近有位 VPS 客户抱怨 MySQL 无缘无故挂掉,还有位客户抱怨 VPS 经常死机,登陆到终端看了一下,都是常见的 Out of memory 问题.这通 ...

  3. Mongodb副本集--Out of memory: Kill process 37325 (mongod)

    1.Mongodb副本集--Out of memory: Kill process 37325 (mongod) 场景描述: 恢复一个22TB数据的mongodb实例的时候. 将备用结点加入mongo ...

  4. Out of memory: Kill process 内存不足

    服务直接被 killed,感觉特别奇怪.代码肯定是没有问题的,但为什么放到服务器上就出错了呢. 部署时报错如下: Failed to add the deployment content to the ...

  5. linux 终端报错 Out of memory: Kill process[PID] [process name] score问题分析

    从Out of memory来看是内存超出了,后面的 Kill process[PID] [process name] score好像和进程有关了,下面我们就一起来看看linux 终端报错 Out o ...

  6. Kill Process by Name

    Kill Process by Name(works in: Microsoft Windows 95/98/ME/NT/2000/XP)It is sometimes necessary to te ...

  7. Android Kill Process

    /********************************************************************** * Android Kill Process * 说明: ...

  8. [LeetCode] Kill Process 结束进程

    Given n processes, each process has a unique PID (process id) and its PPID (parent process id). Each ...

  9. 582. Kill Process杀死所有子代

    [抄题]: Given n processes, each process has a unique PID (process id) and its PPID (parent process id) ...

随机推荐

  1. AD域控服务器更改IP地址步骤

    1.cmd命令行,先停止netlogon服务:net stop netlogon 2.修改本机的IP地址 3.清楚IP缓存:ipconfig /flushdns 4.重启netlogon服务:net ...

  2. atan、atanf、atanl、atan2、atan2f、atan2l

    很久不发博客了,今天在园中计算各种角,于是复习下fan正切函数 计算x的反正切值 (atan.atanf和 atanl) 或y/x 的反正切值 (atan2.atan2f和 atan2l).     ...

  3. netcore里使用jwt做登陆授权

    1 什么是JWT? JWT是一种用于双方之间传递安全信息的简洁的.URL安全的表述性声明规范.JWT作为一个开放的标准(RFC 7519),定义了一种简洁的,自包含的方法用于通信双方之间以Json对象 ...

  4. EasyUI DataGrid 根据ID选中行(转载)

      转载来源: https://blog.csdn.net/chq00788/article/details/51505519 function selectRows(){ //获取需要选中的记录ID ...

  5. ConcurrentLinkedQueue (一)

    ConcurrentLinkedQueue 主要讲一下在JDK8中,ConcurrentLikedQueue是如何入队,出队的. 首先我们要明白,ConcurrentLikedQueue是一种安全的没 ...

  6. Win10-安装.net 2,3,.3.5

    win10x64(ver1809).iso放镜像到光驱后执行cmd(.net3.5包括2和3)dism.exe /online /enable-feature /featurename:NetFx3 ...

  7. springboot2.1.3+Junit4 单元测试

    引入依赖的包: <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core ...

  8. django后台xadmin如下配置(小结)

    django-admin文档:https://xadmin.readthedocs.io/en/latest/index.html目录: 1.xadmin基本配置 2.配置后台显示的模型类 3.后台注 ...

  9. 【转】关于TCP/IP,必须知道的十个知识点

    本文整理了一些TCP/IP协议簇中需要必知必会的十大问题,既是面试高频问题,又是程序员必备基础素养. 一.TCP/IP模型 TCP/IP协议模型(Transmission Control Protoc ...

  10. java ArrayList的remove()方法的参数为int和Integer的问题

    ArrayList的父类List中,有2个remove重载方法: remove(int index) remove(Object o) 假如参数输入为数字类型,到底是删除值等于该数字的对象还是删除索引 ...