Question 1,401 of 1,546
Monitoring, Logging, and RemediationeasyMultiple ChoiceObjective-mapped

Monitor EC2 Memory Metrics in CloudWatch

This SOA-C02 practice question tests your understanding of monitoring, logging, and remediation. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. A key principle to apply: cloudWatch custom metrics. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

An EC2 instance runs a Java application. The operations team wants to monitor heap memory utilization in CloudWatch and set alarms when it exceeds 85 percent. EC2 does not natively publish memory metrics to CloudWatch. What is the simplest way to get this metric into CloudWatch?

Quick Answer

The correct answer is to install the CloudWatch agent on the EC2 instance and configure it to collect mem_used_percent, while having the Java application publish JVM heap metrics using the PutMetricData API. This works because EC2 does not natively publish memory metrics to CloudWatch—it only provides CPU, network, and disk I/O metrics at the hypervisor level. The CloudWatch agent runs inside the instance to capture OS-level memory utilization, and the PutMetricData API allows the application to send custom JVM heap data directly, giving you full visibility into the 85% threshold. On the AWS Certified SysOps Administrator Associate SOA-C02 exam, this scenario tests your understanding that standard EC2 monitoring is insufficient for in-guest metrics, and that the CloudWatch agent is the simplest, agent-based solution for memory monitoring. A common trap is assuming the older CloudWatch Logs agent or a simple script suffices, but only the unified CloudWatch agent can collect both OS metrics and forward custom application metrics. Memory tip: “Agent for OS, API for apps—two tools, one dashboard.”

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 instance and configure it to collect mem_used_percent; publish JVM heap metrics from the application using PutMetricData

Option A is correct because the CloudWatch agent can collect custom metrics like memory utilization from the EC2 instance, and the Java application can directly publish JVM heap metrics to CloudWatch using the PutMetricData API. This combination provides the simplest and most direct way to monitor heap memory utilization and set alarms at the 85% threshold, as EC2 does not natively expose memory metrics.

Key principle: CloudWatch custom metrics

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Install the CloudWatch agent on the instance and configure it to collect mem_used_percent; publish JVM heap metrics from the application using PutMetricData

    Why this is correct

    The CloudWatch agent handles OS-level memory automatically once configured. For JVM heap, the application publishes a custom namespace metric via PutMetricData. Both appear in CloudWatch within minutes and can be graphed and alarmed like any native metric.

    Related concept

    CloudWatch custom metrics

  • Enable detailed monitoring on the EC2 instance to increase metric resolution to 1-minute intervals

    Why it's wrong here

    Detailed monitoring increases the frequency of pre-existing EC2 metrics (CPU, network, disk I/O) from 5 minutes to 1 minute. It does not add memory metrics — EC2 never publishes memory utilization regardless of monitoring detail level.

  • Configure a CloudWatch Logs metric filter on the application log stream to count lines containing 'OutOfMemoryError'

    Why it's wrong here

    A metric filter counting OOM errors indicates memory exhaustion only after it occurs, not the percentage of heap used. This is a reactive indicator, not a proactive utilization metric suitable for setting a threshold alarm at 85 percent.

  • Use AWS Systems Manager Inventory to collect memory data and sync it to CloudWatch

    Why it's wrong here

    SSM Inventory collects hardware and software configuration data (installed applications, OS details, network config) for compliance and asset management. It does not stream real-time memory utilization metrics to CloudWatch.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often assume detailed monitoring or Systems Manager Inventory can provide memory metrics, but neither feature collects or publishes memory utilization data to CloudWatch.

Detailed technical explanation

How to think about this question

The CloudWatch agent uses the 'mem_used_percent' metric from the /proc/meminfo file on Linux or performance counters on Windows, while JVM heap metrics require the application to call the PutMetricData API with a custom namespace and dimensions. In production, you would typically configure the agent to collect both OS-level memory and application-level heap metrics, then create a CloudWatch alarm on the combined metric to trigger auto-scaling or notifications when heap usage exceeds 85%.

KKey Concepts to Remember

  • CloudWatch custom metrics
  • PutMetricData
  • CloudWatch agent
  • memory utilization

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

CloudWatch custom metrics

Real-world example

How this comes up in practice

An e-commerce site experiences heavy traffic on Black Friday and near-zero traffic during off-peak weeks. Rather than provisioning permanent large VMs, the team uses auto-scaling groups that add capacity automatically under load and reduce it overnight. Questions like this test whether you understand elasticity, availability zones, and cloud compute scaling patterns.

What to study next

Got this wrong? Here's your next step.

Review cloudWatch custom metrics, then practise related SOA-C02 questions on the same topic to reinforce the concept.

Related practice questions

Related SOA-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free SOA-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this SOA-C02 question test?

Monitoring, Logging, and Remediation — This question tests Monitoring, Logging, and Remediation — CloudWatch custom metrics.

What is the correct answer to this question?

The correct answer is: Install the CloudWatch agent on the instance and configure it to collect mem_used_percent; publish JVM heap metrics from the application using PutMetricData — Option A is correct because the CloudWatch agent can collect custom metrics like memory utilization from the EC2 instance, and the Java application can directly publish JVM heap metrics to CloudWatch using the PutMetricData API. This combination provides the simplest and most direct way to monitor heap memory utilization and set alarms at the 85% threshold, as EC2 does not natively expose memory metrics.

What should I do if I get this SOA-C02 question wrong?

Review cloudWatch custom metrics, then practise related SOA-C02 questions on the same topic to reinforce the concept.

What is the key concept behind this question?

CloudWatch custom metrics

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 →

How Courseiva writes practice questions · Editorial policy

Keep practising

More SOA-C02 practice questions

Last reviewed: Jun 11, 2026

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.

Loading comments…

Sign in to join the discussion.

This SOA-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 SOA-C02 exam.