Courseiva
Question 60 of 481
What is JavahardMultiple ChoiceObjective-mapped

1Z0-811 What is Java Practice Question

A large enterprise application is experiencing intermittent crashes on a production server running Java 8. The crash logs show 'java.lang.OutOfMemoryError: Metaspace'. The application heavily uses frameworks like Hibernate and JasperReports, which generate many classes dynamically at runtime. The server is configured with default JVM options except for -Xmx2g. A junior administrator suggests increasing -Xmx to 4g. What is the most effective solution to prevent these crashes?

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

Set -XX:MaxMetaspaceSize to a higher value

The crash is caused by Metaspace exhaustion due to dynamic class generation by frameworks like Hibernate and JasperReports. The default MaxMetaspaceSize is unlimited, but the JVM may still hit native memory limits. Setting -XX:MaxMetaspaceSize to a higher value (or leaving it unlimited but with more available memory) directly addresses the issue. Option B (Increasing -Xmx) only increases heap size, which does not affect Metaspace. Option A (UseCompressedOops) optimizes object references in the heap, not class metadata. Option C (UseParallelGC) changes the garbage collector but does not prevent Metaspace growth. Therefore, Option D is the most effective solution.

Answer analysis

Option-by-option breakdown

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

  • Enable -XX:+UseCompressedOops

    Why it's wrong here

    This optimizes heap references, not metaspace capacity.

  • Increase -Xmx to 4g

    Why it's wrong here

    This increases heap, but the error is in metaspace, not heap.

  • Switch to -XX:+UseParallelGC

    Why it's wrong here

    GC algorithm change does not increase metaspace size.

  • Set -XX:MaxMetaspaceSize to a higher value

    Why this is correct

    Directly increases the limit for class metadata storage.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 23, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 1Z0-811 practice question is part of Courseiva's free Oracle 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 1Z0-811 exam.