PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice question 8 of 25

As a Site Reliability Engineer, you support an application written in GO that runs on Google Kubernetes Engine (GKE) in production. After releasing a…

Full set: 205 questions
As a Site Reliability Engineer, you support an application written in GO that runs on Google Kubernetes Engine (GKE) in production. After releasing a new version Of the application, you notice the applicationruns for about 15 minutes and then restarts. You decide to add Cloud Profiler to your application and now notice that the heap usage grows constantly until the application restarts. What should you do?
Answer options
A: Add high memory compute nodes to the cluster.
B: Increase the memory limit in the application deployment. Correct answer
C: Add Cloud Trace to the application, and redeploy.
D: Increase the CPU limit in the application deployment.
Correct Answer:
B. Increase the memory limit in the application deployment.
Explanation

The Cloud Profiler data clearly indicates a memory leak, as the heap usage grows constantly until the application is terminated. In a Kubernetes environment, when a container exceeds its memory limit, it is terminated by the kubelet with an "OOMKilled" (Out of Memory) error, causing a restart. While the long-term solution is to fix the memory leak in the application code, the immediate action an SRE can take to improve service stability and stop the frequent restarts is to increase the memory limit in the deployment configuration. This provides a larger buffer, allowing the application to run longer between restarts while a permanent code fix is developed.

Why Incorrect

A. Adding high-memory nodes does not solve the application-level memory limit issue and is an inefficient way to handle a memory leak. The container will still be OOMKilled.
C. Cloud Trace is used for analyzing latency and request tracing, not for diagnosing memory usage issues, which Cloud Profiler has already successfully identified.
D. The issue is related to memory (heap usage), not CPU. Increasing the CPU limit would have no effect on the OOMKilled errors.

References

1. Google Cloud Documentation, "Debugging memory leaks with Cloud Profiler": "The heap profile shows the memory allocations in your program at the time the profile was collected. ... A continuously growing heap profile is often a symptom of a memory leak."

2. Kubernetes Documentation, "Resource Management for Pods and Containers": "If a Container exceeds its memory limit, it might be terminated. If it is restartable, the kubelet will restart it, as with any other type of runtime failure." Section: "How Pods with resource limits are run".

Scroll to Top