Courseiva

DVA-C02 Troubleshooting and Optimization Practice Question

A developer is using AWS CodeBuild to build a Java application. The build fails with 'OutOfMemoryError'. Which configuration change would most likely resolve this issue?

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

✓

Increase the compute type to a larger instance size.

CodeBuild allows configuring the compute type (e.g., BUILD_GENERAL1_MEDIUM, BUILD_GENERAL1_LARGE) which determines the memory and CPU available. An 'OutOfMemoryError' indicates insufficient memory, so increasing the compute type to a larger instance size provides more memory and resolves the issue. Option A is incorrect because CodeBuild does not support custom AMIs; it uses managed container images. Option B is incorrect because enabling detailed CloudWatch logs only increases logging, not memory. Option D is incorrect because splitting the build adds complexity and does not address the memory shortage in the current build.

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 AMI with more memory.

    Why it's wrong here

    AWS CodeBuild is a fully managed continuous integration service that provisions and manages its build environments. Developers cannot specify custom Amazon Machine Images (AMIs) for CodeBuild projects, as the service utilizes pre-configured, managed images provided by AWS. Therefore, attempting to use a custom AMI with increased memory is not a supported configuration option for CodeBuild, making this approach ineffective for resolving memory constraints.

  • ✗

    Enable detailed CloudWatch logs for the build.

    Why it's wrong here

    Enabling detailed CloudWatch logs for a CodeBuild project primarily enhances visibility into the build process, aiding in debugging and monitoring. While logging consumes a negligible amount of system resources, it does not alter the fundamental memory allocation or compute capacity provided to the build environment itself. Therefore, increasing log verbosity will not resolve an OutOfMemory error, as it does not address the underlying resource limitation.

  • ✓

    Increase the compute type to a larger instance size.

    Why this is correct

    Increasing the compute type is the direct and appropriate method to provide more memory to an AWS CodeBuild project. CodeBuild offers various compute types, such as BUILD_GENERAL1_SMALL, MEDIUM, LARGE, and 2XLARGE, which correspond to different underlying EC2 instance sizes with varying CPU and memory allocations. Selecting a larger compute type directly scales up the resources, including RAM, available to the build container, thereby resolving memory-related build failures.

  • ✗

    Split the build into multiple CodeBuild projects.

    Why it's wrong here

    Splitting a single build into multiple CodeBuild projects might reduce the individual workload of each new project, but it does not inherently increase the memory available for a specific, memory-intensive step within the original build. If a particular compilation or test phase requires more RAM than the current compute type provides, simply distributing other tasks won't solve that specific bottleneck. This approach also introduces significant operational complexity for orchestration and dependency management.

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 DVA-C02 question from scratch — 1,135 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 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.