We are trying to trace a crash of java program in production environment. Java code crashes with the exit code 137. Many searches point to OOM error, but our logs do not prove the OOM condition. strace command shows killed by SIGKILL but does not show any other information.
This is on Ubuntu 20.04, JDK 15
I tried using killsnoop something like following. I know there will be only one java process running.
killsnoop-bpfcc -p `pidof java` &> /tmp/ks.txt
My process dies, but there is no output in ks.txt. My observation is if I redirect the output, killsnoop, it does not work correctly as same command works without redirection when tried with multiple windows open. It seems like it has to do with terminal window where killsnoop was fired being active.
I can't keep killsnoop terminal window open forever. We have session timeout and I can't predict when process will crash - sometimes in ten minutes and sometimes in two days time.
Is there any reason why killsnoop not recording the results? When terminal window is active, it does record properly, but when I log off from window, no results.