Obtenha um dump principal de / depuração de um processo morto por oom-killer

9

Existe alguma maneira de obter um core dump, ou ser capaz de depurar um processo que foi morto pelo oom-killer?

Ou até mesmo definir o oom-killer para tentar matar um processo usando ABRT?

    
por TrapAlice 25.01.2015 / 11:09

2 respostas

5

Outra abordagem é desativar a supercomprometimento de memória.

To restore some semblance of sanity to your memory management:

  1. Disable the OOM Killer (Put vm.oom-kill = 0 in /etc/sysctl.conf)
  2. Disable memory overcommit (Put vm.overcommit_memory = 2 in /etc/sysctl.conf)

These settings will make Linux behave in the traditional way (if a process requests more memory than is available malloc() will fail and the process requesting the memory is expected to cope with that failure).

Note that this is a ternary value:
  • 0 = "estimate if we have enough RAM"
  • 1 = "Always say yes"
  • 2 = "say no if we don't have the memory"

Isso forçará o aplicativo a lidar com a falta de memória, e possivelmente seus logs / coredump / etc. podem lhe dar algo útil.

UPDATE # 1

NOTA: Quando o seu sistema ficar sem memória, você não poderá gerar novos processos! Você pode ser bloqueado do sistema.

    
por 25.01.2015 / 12:08
3
echo 1 > /proc/sys/vm/oom_dump_tasks

que parece ser o máximo que você pode fazer com que o kernel seja exibido em erros de falta de memória.

link

Enables a system-wide task dump (excluding kernel threads) to be produced when the kernel performs an OOM-killing and includes such information as pid, uid, tgid, vm size, rss, nr_ptes, swapents, oom_score_adj score, and name. This is helpful to determine why the OOM killer was invoked, to identify the rogue task that caused it, and to determine why the OOM killer chose the task it did to kill.

If this is set to zero, this information is suppressed. On very large systems with thousands of tasks it may not be feasible to dump the memory state information for each one. Such systems should not be forced to incur a performance penalty in OOM conditions when the information may not be desired.

If this is set to non-zero, this information is shown whenever the OOM killer actually kills a memory-hogging task.

    
por 25.01.2015 / 11:55

Tags