有没有办法防止机器在内存量接近0时变得无响应?

有没有办法防止机器在内存量接近0时变得无响应?

我从内存中运行我的机器,在执行繁重的任务后,它会变得无响应,直到释放大量内存为止。

我的机器有16GB,我的镜像大约3.5GB,我运行intellij,maven等。我仍然无法想象我接近12GB或更多,更不用说16GB了。如果我接近这种情况,我宁愿收到错误消息“无法分配内存”,也不愿让它变得无响应。

我的内存设置:

vm.oom_dump_tasks = 1
vm.oom_kill_allocating_task = 0

vm.overcommit_kbytes = 0
vm.overcommit_memory = 2
vm.overcommit_ratio = 100

vm.swappiness = 60

我在模拟这个问题时遇到的唯一错误是:

[Wed Nov  1 21:47:47 2017] wlan0: failed to remove key (1, 

ff:ff:ff:ff:ff:ff) from hardware (-22)
[Wed Nov  1 21:47:47 2017] wlan0: failed to remove key (2, ff:ff:ff:ff:ff:ff) from hardware (-22)
[Wed Nov  1 21:50:26 2017] udevd[3187]: worker [13086] /devices/platform/regulatory.0 is taking a long time
[Wed Nov  1 21:51:54 2017] udevd[3187]: worker [13086] /devices/platform/regulatory.0 timeout; kill it
[Wed Nov  1 21:51:54 2017] udevd[3187]: seq 2620 '/devices/platform/regulatory.0' killed
[Wed Nov  1 21:52:27 2017] udevd[3187]: worker [13086] terminated by signal 9 (Killed)
[Wed Nov  1 21:52:27 2017] udevd[3187]: worker [13086] failed while handling '/devices/platform/regulatory.0'
[Wed Nov  1 21:52:32 2017] crond (13080) used greatest stack depth: 12120 bytes left
[Wed Nov  1 21:54:12 2017] udevd[3187]: worker [13099] /devices/platform/regulatory.0 is taking a long time
[Wed Nov  1 21:55:55 2017] udevd[13099]: timeout '/usr/sbin/crda'
[Wed Nov  1 21:55:55 2017] udevd[13099]: slow: '/usr/sbin/crda' [13101]
[Wed Nov  1 21:55:55 2017] udevd[3187]: worker [13099] /devices/platform/regulatory.0 timeout; kill it
[Wed Nov  1 21:55:55 2017] udevd[3187]: seq 2621 '/devices/platform/regulatory.0' killed
[Wed Nov  1 21:57:03 2017] udevd[3187]: worker [13099] terminated by signal 9 (Killed)
[Wed Nov  1 21:57:03 2017] udevd[3187]: worker [13099] failed while handling '/devices/platform/regulatory.0'
[Wed Nov  1 21:59:01 2017] udevd[3187]: worker [13118] /devices/platform/regulatory.0 is taking a long time
[Wed Nov  1 22:00:48 2017] udevd[13118]: timeout '/usr/sbin/crda'
[Wed Nov  1 22:00:57 2017] udevd[13118]: slow: '/usr/sbin/crda' [13122]
[Wed Nov  1 22:00:57 2017] udevd[3187]: worker [13118] /devices/platform/regulatory.0 timeout; kill it
[Wed Nov  1 22:00:57 2017] udevd[3187]: seq 2622 '/devices/platform/regulatory.0' killed
[Wed Nov  1 22:01:35 2017] udevd[3187]: worker [13118] terminated by signal 9 (Killed)
[Wed Nov  1 22:01:46 2017] udevd[3187]: worker [13118] failed while handling '/devices/platform/regulatory.0'
[Wed Nov  1 22:03:40 2017] udevd[3187]: worker [13140] /devices/platform/regulatory.0 is taking a long time
[Wed Nov  1 22:05:49 2017] udevd[13140]: timeout '/usr/sbin/crda'
[Wed Nov  1 22:05:54 2017] udevd[3187]: worker [13140] /devices/platform/regulatory.0 timeout; kill it
[Wed Nov  1 22:05:54 2017] udevd[3187]: seq 2623 '/devices/platform/regulatory.0' killed
[Wed Nov  1 22:06:03 2017] udevd[3187]: worker [13140] terminated by signal 9 (Killed)
[Wed Nov  1 22:06:03 2017] udevd[3187]: worker [13140] failed while handling '/devices/platform/regulatory.0'
[Wed Nov  1 22:08:00 2017] udevd[3187]: worker [13164] /devices/platform/regulatory.0 is taking a long time
[Wed Nov  1 22:09:50 2017] udevd[3187]: worker [13164] /devices/platform/regulatory.0 timeout; kill it
[Wed Nov  1 22:09:50 2017] udevd[3187]: seq 2624 '/devices/platform/regulatory.0' killed
[Wed Nov  1 22:09:50 2017] crda (13170) used greatest stack depth: 12104 bytes left
[Wed Nov  1 22:10:08 2017] udevd[3187]: worker [13164] terminated by signal 9 (Killed)
[Wed Nov  1 22:10:21 2017] udevd[3187]: worker [13164] failed while handling '/devices/platform/regulatory.0'
[Wed Nov  1 22:11:49 2017] udevd[3187]: worker [13180] /devices/platform/regulatory.0 is taking a long time
[Wed Nov  1 22:13:57 2017] udevd[3187]: worker [13180] /devices/platform/regulatory.0 timeout; kill it
[Wed Nov  1 22:13:57 2017] udevd[3187]: seq 2625 '/devices/platform/regulatory.0' killed

相关内容