Bird
0
0

Which of the following is the correct way to set the Java heap size for a Hadoop container in the configuration?

easy📝 Syntax Q12 of 15
Hadoop - Performance Tuning
Which of the following is the correct way to set the Java heap size for a Hadoop container in the configuration?
Amapreduce.map.memory.mb=512\nmapreduce.map.java.opts=-Xmx5120m
Bmapreduce.map.memory.mb=2048\nmapreduce.map.java.opts=-Xmx1536m
Cmapreduce.map.memory.mb=1024\nmapreduce.map.java.opts=-Xmx2048m
Dmapreduce.map.memory.mb=4096\nmapreduce.map.java.opts=-Xmx8192m
Step-by-Step Solution
Solution:
  1. Step 1: Understand heap size vs container memory and check options

    Java heap size (-Xmx) must be less than container memory to avoid errors. mapreduce.map.memory.mb=2048\nmapreduce.map.java.opts=-Xmx1536m sets container memory to 2048 MB and heap to 1536 MB, which is valid. Others have heap larger than container memory, causing errors.
  2. Final Answer:

    mapreduce.map.memory.mb=2048\nmapreduce.map.java.opts=-Xmx1536m -> Option B
  3. Quick Check:

    Heap size < container memory [OK]
Quick Trick: Heap size must be smaller than container memory [OK]
Common Mistakes:
  • Setting heap size larger than container memory
  • Using inconsistent units (MB vs GB)
  • Forgetting to set Java opts after memory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Hadoop Quizzes