Raise your Kubernetes memory limit, or lower the JVM heap size. If the container gets OOM-killed there is nothing it can do to still dump something. By lowering the heap size you may be able to provoke an OutOfMemoryException within the JVM before it gets killed; with the right flags set it will do a heap dump then.
In general, when setting these limits, account for off-heap memory usage.
Make it heap dump onto a volumeMount (emptyDir or some network storage if you have it). If nothing else you can then `kubectl exec` in after it restarted to extract those files.
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.
No, the OOM killer is a last-resort action by the kernel because it is completely out of usable memory (for this container or globally). At this point, nothing and no one can interfere anymore, because to do so they would need memory that is not available until after the OOM killer.