spring-bootdockerkubernetesjvmexit-code

Kubernetes Pod terminates with Exit Code 143


I am using a containerized Spring boot application in Kubernetes. But the application automatically exits and restarts with exit code 143 and error message "Error".

I am not sure how to identify the reason for this error.

My first idea was that Kubernetes stopped the container due to too high resource usage, as described here, but I can't see the corresponding kubelet logs.

Is there any way to identify the cause/origin of the SIGTERM? Maybe from spring-boot itself, or from the JVM?


Solution

  • I also encountered similar problems too.

    Because my program has scheduled task execution, I finally found out that a piece of my code was causing a memory leak by using Jmeter pressure testing locally and combining it with JProfiler.

    As the program runs, the memory in the Eden area gradually decreases, and the Old area gradually increases until it reaches the maximum JVM heap memory, which finally triggers a container restart!