Courseiva
SDLC Automation →mediumMultiple Choice

DOP-C02 SDLC Automation Practice Question

A company uses AWS CodeBuild to compile Java applications. The builds often fail due to insufficient memory. The buildspec currently specifies 'compute-type: BUILD_GENERAL1_SMALL'. What is the most cost-effective solution to resolve the memory issues without changing the build logic?

⚠ Common exam trap

It's easy for candidates to think caching or parallelism can solve memory issues, but neither addresses the fundamental lack of memory per build instance, and the fabricated environment variable 'MEMORY_OVERPROVISION' is designed to lure those who guess at undocumented features.

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 compute-type to 'BUILD_GENERAL1_MEDIUM' or 'BUILD_GENERAL1_LARGE' in the buildspec.

The most direct and cost-effective way to resolve insufficient memory in AWS CodeBuild is to increase the compute type to a larger size (e.g., BUILD_GENERAL1_MEDIUM or BUILD_GENERAL1_LARGE), which provides more memory without altering the build logic. This change incurs additional cost only when builds run, and it avoids unnecessary complexity or invalid approaches.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Change the compute-type to 'BUILD_GENERAL1_MEDIUM' or 'BUILD_GENERAL1_LARGE' in the buildspec.

    Why this is correct

    Upgrading the compute type in the buildspec—from the default BUILD_GENERAL1_SMALL (3 GB memory) to BUILD_GENERAL1_MEDIUM (7 GB) or BUILD_GENERAL1_LARGE (15 GB)—is the correct fix because CodeBuild's compute-type property directly controls the memory and vCPU allocated to the build container. Java compilation through Maven or Gradle is memory-intensive, and a small instance can easily cause the JVM or compiler daemon to run out of heap space. Selecting a larger general-purpose tier gives the build process a proportionally larger heap and OS memory, resolving the OOM without changing application code.

  • ✗

    Enable Amazon S3 caching for the build artifacts to reduce memory usage.

    Why it's wrong here

    Enabling Amazon S3 caching stores build dependencies, caches, and artifacts in S3 so subsequent builds can reuse them, but this only reduces network time, dependency resolution, and disk I/O during the build. It does not alter the JVM heap, the compiler's working set, or the CodeBuild container's memory limit—those are fixed by the compute type. Caching artifacts is about persisting outputs, not about providing additional RAM to a process that is already hitting the memory ceiling.

  • ✗

    Split the build into multiple parallel CodeBuild actions in the pipeline, each compiling a subset of the code.

    Why it's wrong here

    Splitting the build into multiple parallel CodeBuild actions in the pipeline does not increase the memory available to any single Java compile process. Each parallel action would run in its own container with its own memory limit, and unless the source code and build logic are explicitly refactored into independent modules, Maven/Gradle still need to compile the entire project's classes in one JVM. Parallelism helps wall-clock time for independent tasks, but it does nothing for a JVM that exhausts its heap while compiling a large codebase; in fact, you could still hit the same OOM in each parallel container.

  • ✗

    Set the environment variable 'MEMORY_OVERPROVISION=2' in the buildspec.

    Why it's wrong here

    CodeBuild does not support a 'MEMORY_OVERPROVISION' environment variable or any equivalent setting. Environment variables in CodeBuild are simply passed to the build commands; they cannot change the underlying container's memory allocation, which is strictly determined by the selected compute-type (e.g., BUILD_GENERAL1_SMALL, MEDIUM, LARGE). Any attempt to set this variable is ignored and provides no additional memory, so this option is invalid as a solution.

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 — 1,298 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

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.