Courseiva

How to Monitor EC2 Memory Utilization with CloudWatch Agent

A SysOps administrator needs to monitor memory utilization on an Amazon EC2 instance. Memory metrics are not available by default in Amazon CloudWatch for EC2 instances. Which action should the administrator take to collect memory utilization metrics?

Quick Answer

The correct answer is to install the CloudWatch agent on the EC2 instance. This is because standard EC2 monitoring only captures hypervisor-level metrics like CPU, network, and disk I/O, but memory utilization is an in-guest metric that requires the CloudWatch agent to read the operating system’s memory counters and publish them as custom metrics to CloudWatch. On the AWS Certified SysOps Administrator Associate SOA-C02 exam, this scenario tests your understanding of the distinction between default and custom metrics, often appearing in questions about monitoring gaps or troubleshooting performance. A common trap is assuming that enabling detailed monitoring or using the older SSM agent alone will collect memory data—neither does; only the CloudWatch agent with the proper configuration can collect EC2 memory metrics. Remember the mnemonic: “Default is hypervisor, memory needs a visitor”—the CloudWatch agent is the visitor inside the guest OS.

⚠ Common exam trap

Watch out — candidates often confuse 'detailed monitoring' (which increases metric frequency) with the ability to collect new metric types, assuming it will magically include memory metrics when it only affects existing hypervisor-level metrics.

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 instance

The CloudWatch agent is the correct solution because it can collect custom metrics, including memory utilization, from EC2 instances. Unlike the default hypervisor-level metrics (CPU, network, disk), memory metrics require an in-guest agent to read the operating system's memory counters and publish them to CloudWatch.

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 EC2 instance

    Why this is correct

    The CloudWatch agent runs on the instance and collects guest-level metrics, including memory utilisation, which the hypervisor cannot see. Installing it satisfies the requirement because EC2's default CloudWatch metrics cover CPU, disk and network only, never memory.

  • ✗

    Enable detailed monitoring on the EC2 instance

    Why it's wrong here

    Detailed monitoring only shortens the interval for the hypervisor-level metrics EC2 already provides (CPU, disk, network); memory remains unavailable because the hypervisor cannot see inside the guest OS. It is tempting because it increases metric granularity, and it would be correct when one-minute CPU or network resolution is required.

  • ✗

    Use an AWS Lambda function to query the EC2 instance for memory metrics

    Why it's wrong here

    Lambda cannot read an instance's memory counters; those exist only inside the guest OS, so querying EC2 APIs returns no utilisation data. It is tempting because Lambda plus the CloudWatch agent or SSM can push custom metrics, and that approach would be correct for scheduled automation, not for collecting OS-level memory.

  • ✗

    Use Amazon Inspector to collect memory metrics

    Why it's wrong here

    Amazon Inspector performs vulnerability and network reachability assessments; it does not read guest OS memory counters. It is tempting because Inspector targets EC2 instances and reports findings, and it would be the right service for identifying software vulnerabilities or unintended network exposure, not for publishing memory utilisation metrics.

About these practice questions

Courseiva writes every SOA-C02 question from scratch — 1,169 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on SOA-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A SysOps administrator needs to monitor memory utilization of an Amazon EC2 instance. The default Amazon CloudWatch metrics for EC2 do not include memory utilization. Which solution should the administrator implement to collect memory metrics and set alarms?

medium
  • ✓ A.Install the CloudWatch agent on the instance and configure it to collect memory metrics
  • B.Enable detailed monitoring on the EC2 instance
  • C.Use AWS Systems Manager Patch Manager to report memory usage
  • D.Use AWS CloudTrail to log memory events

Why A: The CloudWatch agent is specifically designed to collect custom metrics, such as memory utilization, from EC2 instances and on-premises servers. Unlike the default EC2 metrics, which only capture hypervisor-level metrics (e.g., CPU, disk I/O, network), memory utilization requires OS-level access. The CloudWatch agent uses the `mem` plugin to gather memory data and can publish it to CloudWatch as custom metrics, enabling alarm configuration.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.