Resolving OutOfMemoryError in Kinesis Data Analytics
A company uses Amazon Kinesis Data Analytics for Apache Flink to process streaming data. The application reads from a Kinesis data stream and writes results to a sink. The application is failing with an 'OutOfMemoryError'. The application has parallelism set to 4 and uses 1 Kinesis Processing Unit (KPU). What is the MOST likely cause and solution?
Quick Answer
The correct answer is to increase parallelism to 8 because the application’s heap memory per operator is too low. With parallelism set to 4 and only 1 Kinesis Processing Unit (KPU), each operator slot receives a fraction of the 4 GB of heap memory, causing an OutOfMemoryError when processing spikes. Increasing parallelism to 8 forces Kinesis Data Analytics to provision additional KPUs, which adds more total heap memory (each KPU provides 4 GB), resolving the memory pressure. On the AWS Certified Machine Learning Specialty MLS-C01 exam, this scenario tests your understanding of how parallelism and KPUs interact in Flink-based streaming applications—a common trap is assuming that increasing parallelism alone without considering KPU allocation will fix memory errors. Remember: more parallelism without more KPUs just divides the same small heap into even smaller pieces. Memory tip: “Parallelism without KPUs is just slicing a thin pie thinner.”
⚠ Common exam trap
Many exam-takers assume increasing parallelism always reduces per-operator memory, but in Kinesis Data Analytics, parallelism is tied to KPU allocation, so increasing parallelism can actually increase total memory by provisioning more KPUs.
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
✓
The heap memory per operator is too low; increase parallelism to 8.
With parallelism set to 4 but only 1 KPU, each operator slot receives a fraction of the available heap memory, leading to an OutOfMemoryError. Increasing parallelism to 8 distributes the workload across more slots, but more importantly, it forces Kinesis Data Analytics to allocate additional KPUs (each KPU provides 4 GB of memory), thereby increasing the total heap memory available to the application.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The application is using too many operators; reduce parallelism to 2.
Why it's wrong here
Reducing parallelism may cause each operator to process more data, worsening OOM.
- ✓
The heap memory per operator is too low; increase parallelism to 8.
Why this is correct
Higher parallelism allocates more total memory across tasks.
- ✗
The checkpoint interval is too short; increase it to 5 minutes.
Why it's wrong here
Checkpointing does not affect heap memory.
- ✗
The buffer timeout is too high; reduce it to 50 ms.
Why it's wrong here
Buffer timeout does not cause OOM.
Go deeper
Related to this question
About these practice questions
One of 1,672 original MLS-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on MLS-C01
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 company uses Amazon Kinesis Data Analytics for real-time anomaly detection on a stream of IoT sensor data. The application is experiencing high latency. The data volume has doubled. Which action would MOST effectively reduce latency?
hard- ✓ A.Increase the Parallelism setting of the Kinesis Data Analytics application
- B.Change the record format from JSON to Avro
- C.Decrease the retention period of the source stream
- D.Increase the number of shards in the source Kinesis stream
Why A: Increasing the Parallelism setting of the Kinesis Data Analytics application directly allocates more processing resources (e.g., more Kinesis Processing Units or KPUs) to handle the doubled data volume. This allows the application to process records concurrently, reducing the per-record processing time and overall latency. Parallelism is the primary scaling mechanism for Kinesis Data Analytics to match throughput increases.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This MLS-C01 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 MLS-C01 exam.