Question 1,209 of 724
DVA-C02 Troubleshooting and Optimization Practice Question
A developer is managing an application running on Amazon EC2 instances behind an Application Load Balancer. Users report that the application becomes unresponsive after several hours, and restarting the instance temporarily fixes the issue. The developer suspects a memory leak but cannot add custom instrumentation. Which AWS service can collect memory utilization metrics and help identify the memory leak with minimal configuration?
⚠ Common exam trap
Many exam-takers assume EC2 automatically provides memory metrics in CloudWatch, but in reality, only CPU, network, and disk metrics are available by default; memory requires the CloudWatch agent.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Install the CloudWatch agent on the EC2 instances to collect memory metrics and emit them to CloudWatch.
The CloudWatch agent can collect custom metrics, including memory utilization, from EC2 instances and publish them to Amazon CloudWatch. This allows the developer to monitor memory usage over time and identify a memory leak without modifying the application code. The default EC2 metrics do not include memory utilization, so the CloudWatch agent is the minimal-configuration solution for this requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Amazon CloudWatch Logs agent to capture application logs.
Why it's wrong here
The Amazon CloudWatch Logs agent is specifically designed to collect log files from EC2 instances and stream them to CloudWatch Logs for storage and analysis. While application logs might occasionally contain memory-related information if explicitly written by the application, the Logs agent itself does not directly collect system-level memory utilization metrics. Inferring precise memory usage from application logs would be an indirect, unreliable, and inefficient method compared to direct metric collection.
- ✗
Use the EC2 instance metadata service to query memory usage.
Why it's wrong here
The EC2 instance metadata service provides information about the instance itself, such as its instance ID, public IP address, AMI ID, and security group assignments. This service offers static or semi-static configuration details and properties of the instance, not dynamic, real-time operating system-level metrics like CPU utilization, disk I/O, or memory usage. Therefore, the instance metadata service cannot be used to query or monitor memory utilization.
- ✓
Install the CloudWatch agent on the EC2 instances to collect memory metrics and emit them to CloudWatch.
Why this is correct
The unified CloudWatch agent is the correct and recommended solution for collecting detailed operating system-level metrics, including memory utilization, from EC2 instances. This agent can be configured to gather various custom metrics, such as used memory percentage, free memory, and swap usage, directly from the instance's operating system. These collected metrics are then reliably published to CloudWatch, enabling comprehensive monitoring, alarming, and dashboarding capabilities.
- ✗
Use AWS X-Ray to trace memory allocation.
Why it's wrong here
AWS X-Ray is a distributed tracing service primarily used to analyze and debug production applications by tracing requests as they flow through various services. It helps identify performance bottlenecks, latency issues, and errors across microservices and serverless applications. X-Ray is designed to provide insights into request paths and service interactions, not to monitor system-level resource utilization like memory allocation or overall memory usage on an EC2 instance.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 11, 2026
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.