我配置了一些交换,我相信已激活...
Filename Type Size Used Priority
/dev/sda5 partition 7811068 1124912 200
/mnt/data02/swapfile file 134217724 37032 100
/home/swapfile file 134217724 36600 -1
但是,当系统监视器显示内存已达到100%时,系统倾向于通过关闭/崩溃程序来做出响应。Xorg和无线驱动程序一样都以这种方式崩溃。发生这种情况时,系统监视器显示对交换的使用很少(低于5 GiB)。我已确认swappiness并未设置为极值(并且此参数的更改似乎对该问题没有影响)。
~$ cat /proc/sys/vm/swappiness
70
系统有大量的RAM ...
~$ free -h
total used free shared buffers cached
Mem: 125G 20G 105G 161M 54M 1.1G
-/+ buffers/cache: 19G 106G
Swap: 263G 1.1G 262G
...但是有时我会在内存资源上运行超额预算,如果它比崩溃更正常地失败,那将是很好的。
我该怎么做才能解决这个问题?
编辑
~$ cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda3 during installation
UUID=8dfbed62-9957-4f06-b4e1-a42020adec91 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda6 during installation
UUID=b6f33408-1d8b-4302-9983-5c778ef64f47 /home ext4 defaults 0 2
# swap was on /dev/sda5 during installation
# ae0304dd-e63e-4d3a-99da-9c9d7a034c6e is the swap file
UUID=fd4c00c9-49bf-4562-adea-1c817fc57ce9 none swap sw,pri=200 0 0
UUID=3A323DCA323D8BBF /mnt/data01 ntfs-3g defaults,windows_names,locale=en_US.utf8 0 0
UUID=4cc8a19d-5991-4186-8f65-7062805b66a6 /mnt/data02 ext4 defaults 0 0
/mnt/data02/swapfile none swap sw,pri=100 0 0
/home/swapfile none swap sw 0,pri=150 0
编辑2
为了回应下面的评论,我看到我的系统执行了一个我知道会使用所有可用RAM而不是所有可用交换的操作,然后dmesg
在故障期间和之后进行检查。系统交换并间歇性地变得无响应(正常行为)。然后,当交换容量不足10%时,Chrome崩溃了(Sorry, the program "chrome" closed unexpectedly. Your computer does not have enough free memory to automatically analyze the problem and send a report to the developers
)。试图返回到dmesg输出,我看到了一条错误消息,指出This window is not responding. Do you want to force the application to exit, or wait for it to respond
。我选择了“等待”。重新出现桌面,并且在系统交换时,gnome系统监视器多次变灰变亮。当我重新签到时,我在Ubuntu登录屏幕上。我以正常身份登录...我所有较早运行的进程都消失了,并收到一条错误消息,该错误消息与有关Xorg的有关Chrome的错误消息相同。检查dmesg仅显示以下两条消息:
[131267.206774] Watchdog[3433]: segfault at 0 ip 00007fe38faf9756 sp 00007fe37f393770 error 6 in chrome[7fe38be0a000+510c000]
[133329.875212] nvidia 0000:03:00.0: irq 106 for MSI/MSI-X
编辑3 其他可能的相关主题:
- 即使仍然有足够的可用内存,也可能会调用OOM杀手,尽管我仍然不确定如何检查是否调用了OOM。
- 可能一些pages_low / min_free_kbytes的配置可以使我到达需要的位置,它比swappiness更直接相关,但是我看不到[有些网站建议我应该在/ proc / zoneinfo中找到(我无法发布链接) :mariosmarduch.ulitzer.com/node/431838/mobile),但这可能是因为它们不是特定于Ubuntu的?
- 我无法发布链接:www.linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html?page=1
编辑4 其他错误消息:
[92315.165728] Watchdog[1319]: segfault at 0 ip 00007f7d0a417756 sp 00007f7cf9cb1770 error 6 in chrome[7f7d06728000+510c000]
[92656.478271] INFO: task Chrome_IOThread:1292 blocked for more than 120 seconds.
[92656.478275] Tainted: P OX 3.13.0-45-generic #74-Ubuntu
[92656.478276] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[92656.478278] Chrome_IOThread D ffff88207fc534c0 0 1292 32756 0x00000000
[92656.478282] ffff881fa9d15dd8 0000000000000086 ffff881fad2ab000 ffff881fa9d15fd8
[92656.478285] 00000000000134c0 00000000000134c0 ffff881fad2ab000 ffff881fad2ab000
[92656.478288] ffff881f5fce6260 ffff881f5fce6268 ffffffff00000000 ffff881f5fce6270
[92656.478290] Call Trace:
[92656.478299] [<ffffffff817252d9>] schedule+0x29/0x70
[92656.478302] [<ffffffff81727f55>] rwsem_down_write_failed+0x115/0x230
[92656.478307] [<ffffffff81371d63>] call_rwsem_down_write_failed+0x13/0x20
[92656.478311] [<ffffffff81314c90>] ? apparmor_file_mprotect+0x30/0x30
[92656.478313] [<ffffffff8172796d>] ? down_write+0x2d/0x30
[92656.478318] [<ffffffff8116ba7c>] vm_mmap_pgoff+0x6c/0xc0
[92656.478322] [<ffffffff8117f916>] SyS_mmap_pgoff+0x116/0x270
[92656.478325] [<ffffffff81018802>] SyS_mmap+0x22/0x30
[92656.478328] [<ffffffff8173196d>] system_call_fastpath+0x1a/0x1f
mmap(...,MAP_LOCKED)
仅在RAM中分配内存(带有),不可交换等。chrome和图形驱动程序的确具有suid部分(请参阅chrome沙箱)。因此,即使有可用的交换,您也可以具有OOM条件-仅用于这种内存。我不知道这是否会触发OOM杀手,或者只是分配失败而进程会杀死自己-这就是为什么这只是评论而不是答案。