On Thu, 2 Nov 2017 15:59:10 -0700
Jamo Luhrsen <[email protected]> wrote:
> On 11/02/2017 03:49 PM, Michael Vorburger wrote:
> > On Thu, Nov 2, 2017 at 11:02 PM, Luis Gomez <[email protected]
> > <mailto:[email protected]>> wrote:
> >     So I wonder if there is some java memory combination of
> > parameters to prevent OS to kill the JVM, something like if the
> > total java memory (Xmx and others)=3G, abort and generate heap dump.
> > 
> > No, I don't think so - as Jamo says, the JVM seems to just get
> > kill-9'd by the OS, so no JVM parameter will helps us; it's...
> > like.. too late. But if we can't figure it out using any of the
> > ideas above, then I guess we'll have to go lower.. I'm a little bit
> > less familiar with the OS level stuff, but I'm sure one of you
> > know, or can figure out how, to get the OS to produce one of those
> > coredump files when it kills a process? Thing is I don't know what
> > to do with such a file, and how to analyze its memory content...
> > but I guess we'll have to find someone who does! Once you have it.  
> 
> anyone know how to do this?

There is one thing we can try, which is to disable the OOM killer; that
way, the JVM will continue trying to allocate memory, and kill itself
(with a heapdump etc.).

To disable the OOM killer, you need to wait for the JVM to start, then
look for /proc/<pid>/oom_* files (replacing <pid> with the appropriate
value). If there’s an oom_score_adj file, echo -1000 to it:

    echo -1000 | sudo tee /proc/<pid>/oom_score_adj

or

    echo -1000 > /proc/<pid>/oom_score_adj

if you’re running as root. If there’s no oom_score_adj file, there
should be an oom_adj file (this is the older interface); echo -17 to
that instead:

    echo -17 | sudo tee /proc/<pid>/oom_adj

or

    echo -17 > /proc/<pid>/oom_adj

This will disable the OOM killer for the JVM only, so when the system
runs out of memory there may be adverse consequences on other processes
(basically, make sure you have an SSH session running beforehand).

It is also possible to disable the OOM killer entirely, but then
processes which run out of memory are *suspended* and can’t be mapped.
Another avenue could be to look at the overcommit settings, but I
suspect that the JVM would fail to start altogether if we adjusted
those.

Regards,

Stephen

Attachment: pgpwhUfjeWvvv.pgp
Description: OpenPGP digital signature

_______________________________________________
controller-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/controller-dev

Reply via email to