java.lang.OutOfMemoryError: Requested array size exceeds VM limit

JDK Bug System | Shadow Bug | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.

Root Cause Analysis

  1. java.lang.OutOfMemoryError

    Requested array size exceeds VM limit

    at java.util.Arrays.copyOf()
  2. Java RT
    StringBuilder.ensureCapacity
    1. java.util.Arrays.copyOf(Arrays.java:3332)
    2. java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137)
    3. java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121)
    4. java.lang.AbstractStringBuilder.ensureCapacity(AbstractStringBuilder.java:111)
    5. java.lang.StringBuilder.ensureCapacity(StringBuilder.java:76)
    5 frames