java.lang.OutOfMemoryError: Java heap space

QOS.ch JIRA | James Stauffer | 3 years ago
  1. 0

    When I load a 90MB file into a String and try to log it I get the following: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source) at java.lang.AbstractStringBuilder.append(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at ch.qos.logback.core.pattern.FormattingConverter.write(FormattingConverter.java:40) at ch.qos.logback.core.pattern.PatternLayoutBase.writeLoopOnConverters(PatternLayoutBase.java:119) at ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:168) at ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:59) at ch.qos.logback.core.encoder.LayoutWrappingEncoder.doEncode(LayoutWrappingEncoder.java:134) at ch.qos.logback.core.OutputStreamAppender.writeOut(OutputStreamAppender.java:188) at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:206) at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:175) at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103) at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:272) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:259) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:441) at ch.qos.logback.classic.Logger.filterAndLog_1(Logger.java:413) at ch.qos.logback.classic.Logger.debug(Logger.java:506) ... Appender: ch.qos.logback.core.rolling.RollingFileAppender Pattern: %p %d{HH:mm:ss.SSS} %c:%L %X{DC4ParcelID} %m%n Maybe when the message is too big, it can use a more memory efficient method to log (or reduce functionality).

    QOS.ch JIRA | 3 years ago | James Stauffer
    java.lang.OutOfMemoryError: Java heap space
  2. 0

    When I load a 90MB file into a String and try to log it I get the following: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source) at java.lang.AbstractStringBuilder.append(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at ch.qos.logback.core.pattern.FormattingConverter.write(FormattingConverter.java:40) at ch.qos.logback.core.pattern.PatternLayoutBase.writeLoopOnConverters(PatternLayoutBase.java:119) at ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:168) at ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:59) at ch.qos.logback.core.encoder.LayoutWrappingEncoder.doEncode(LayoutWrappingEncoder.java:134) at ch.qos.logback.core.OutputStreamAppender.writeOut(OutputStreamAppender.java:188) at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:206) at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:175) at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103) at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:272) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:259) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:441) at ch.qos.logback.classic.Logger.filterAndLog_1(Logger.java:413) at ch.qos.logback.classic.Logger.debug(Logger.java:506) ... Appender: ch.qos.logback.core.rolling.RollingFileAppender Pattern: %p %d{HH:mm:ss.SSS} %c:%L %X{DC4ParcelID} %m%n Maybe when the message is too big, it can use a more memory efficient method to log (or reduce functionality).

    QOS.ch JIRA | 3 years ago | James Stauffer
    java.lang.OutOfMemoryError: Java heap space
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    FileListEntityProcessor + java heap exception

    Stack Overflow | 3 years ago | prerna Keshari
    java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: java.lang.OutOfMemoryError: Java heap space
  5. 0

    Spring - cannot load XML file with beans using ClassPathXmlApplicationContext

    Stack Overflow | 5 years ago | yons88
    java.lang.OutOfMemoryError: Java heap space
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.OutOfMemoryError

    Java heap space

    at java.util.Arrays.copyOf()
  2. Java RT
    StringBuilder.append
    1. java.util.Arrays.copyOf(Unknown Source)
    2. java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
    3. java.lang.AbstractStringBuilder.append(Unknown Source)
    4. java.lang.StringBuilder.append(Unknown Source)
    4 frames
  3. Logback Core Module
    PatternLayoutBase.writeLoopOnConverters
    1. ch.qos.logback.core.pattern.FormattingConverter.write(FormattingConverter.java:40)
    2. ch.qos.logback.core.pattern.PatternLayoutBase.writeLoopOnConverters(PatternLayoutBase.java:119)
    2 frames
  4. Logback Classic Module
    PatternLayout.doLayout
    1. ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:168)
    2. ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:59)
    2 frames
  5. Logback Core Module
    AppenderAttachableImpl.appendLoopOnAppenders
    1. ch.qos.logback.core.encoder.LayoutWrappingEncoder.doEncode(LayoutWrappingEncoder.java:134)
    2. ch.qos.logback.core.OutputStreamAppender.writeOut(OutputStreamAppender.java:188)
    3. ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:206)
    4. ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212)
    5. ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:175)
    6. ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103)
    7. ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88)
    8. ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
    8 frames
  6. Logback Classic Module
    Logger.debug
    1. ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:272)
    2. ch.qos.logback.classic.Logger.callAppenders(Logger.java:259)
    3. ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:441)
    4. ch.qos.logback.classic.Logger.filterAndLog_1(Logger.java:413)
    5. ch.qos.logback.classic.Logger.debug(Logger.java:506)
    5 frames