Courseiva
SDLC AutomationhardMultiple ChoiceObjective-mapped

Increasing CodeBuild Compute Type to Resolve Memory Issues

A company uses AWS CodeBuild to run unit tests as part of their CI/CD pipeline. The tests are memory-intensive and occasionally fail due to insufficient memory. The buildspec.yml file uses the default compute type. What is the most cost-effective solution to resolve the memory issue?

Quick Answer

The most cost-effective solution to resolve CodeBuild memory insufficient errors is to change the build project's compute type to a larger instance, such as from BUILD_GENERAL1_SMALL to BUILD_GENERAL1_MEDIUM. This directly increases the available memory for the build environment without requiring code changes or additional services, as the compute type determines the underlying instance's RAM and vCPU allocation. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this scenario tests your understanding of CodeBuild compute types as a first-line troubleshooting step for resource exhaustion, often appearing in questions that contrast quick infrastructure fixes against time-consuming code refactoring. A common trap is assuming caching or environment changes will help, but neither increases memory—only scaling the compute type does. Memory tip: think of compute types like rental car tiers—if your luggage doesn’t fit in a compact, you don’t repack; you just upgrade to a midsize.

⚠ Common exam trap

Candidates often confuse memory issues with disk I/O or think that parallelizing tests will reduce per-instance memory pressure, but in reality, each parallel build runs on its own instance with the same memory limit, so the failure persists and costs increase.

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

Change the build project's compute type to a larger instance (e.g., from BUILD_GENERAL1_SMALL to BUILD_GENERAL1_MEDIUM).

Increasing the compute type (e.g., from BUILD_GENERAL1_SMALL to BUILD_GENERAL1_MEDIUM) directly provides more memory for the build environment, resolving the out-of-memory failures. This is the most cost-effective solution as it only increases resources for the specific build project that needs them, without requiring architectural changes or additional build projects.

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 a custom build environment with the same compute type.

    Why it's wrong here

    Custom environment does not change memory allocation.

  • Enable local caching in the build project to reduce disk I/O.

    Why it's wrong here

    Caching does not increase memory.

  • Change the build project's compute type to a larger instance (e.g., from BUILD_GENERAL1_SMALL to BUILD_GENERAL1_MEDIUM).

    Why this is correct

    Larger compute types provide more memory.

  • Split the tests into multiple build projects and run them in parallel.

    Why it's wrong here

    This may not solve the memory issue for individual tests.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 251 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 DOP-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. An organization uses AWS CodeBuild to run integration tests. The tests require a large amount of memory and CPU, and they often timeout after the default 60 minutes. What is the MOST efficient way to increase the timeout and allocate more resources?

medium
  • A.Use Amazon CloudWatch to monitor the build and automatically restart it if it times out.
  • B.Use AWS Lambda instead of CodeBuild, as it can run up to 15 minutes.
  • C.Select a larger instance type in the CodeBuild project configuration, such as 'BUILD_GENERAL1_LARGE'.
  • D.Modify the buildspec.yml file to include 'compute-type' and 'timeout-in-minutes' overrides.

Why C: In AWS CodeBuild, the compute type (e.g., BUILD_GENERAL1_LARGE) is a project-level configuration, not a buildspec override. To increase memory and CPU, you must select a larger compute type in the CodeBuild project settings. Additionally, the timeout can be increased in the project configuration or via the AWS CLI/API, not in the buildspec.yml. This approach is the most efficient and reliable way to allocate more resources and extend the timeout.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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