java.lang.OutOfMemoryError: Java heap space

directory-users | Kiran Ayyagari | 3 years ago
  1. 0

    Re: parseLdifFile Run out of memory

    directory-users | 3 years ago | Kiran Ayyagari
    java.lang.OutOfMemoryError: Java heap space
  2. 0

    Using the DataStax Java Driver, we've written code to stream in the contents of a table from DSE and combine it into a map. This works, but HashMap throws an OutOfMemoryException which is caught by SL4J. (see below) The cause of this exception seems to be TRACE logs of responses from Cassandra. We think that when logging is disabled, the responses are parsed with protocolVersion V2, and the hash table is allocated with 256 entries. When logging is enabled, the responses are parsed with protocolVersion V3 by the toString code, and the hash table is allocated with 16777236 entries. HashMap throws an OutOfMemoryException when it attempts to allocate the underlying array. The version of C* we use is 2.0.x (and thus is running on protocol version V2) {code} SLF4J: Failed toString() invocation on an object of type [com.datastax.driver.core.Responses$Result$Rows] java.lang.OutOfMemoryError: Java heap space at java.util.HashMap.<init>(HashMap.java:187) at java.util.LinkedHashMap.<init>(LinkedHashMap.java:160) at java.util.HashSet.<init>(HashSet.java:142) at java.util.LinkedHashSet.<init>(LinkedHashSet.java:129) at com.datastax.driver.core.TypeCodec$SetCodec.deserialize(TypeCodec.java:1073) at com.datastax.driver.core.TypeCodec$SetCodec.deserialize(TypeCodec.java:1001) at com.datastax.driver.core.DataType.deserialize(DataType.java:606) at com.datastax.driver.core.Responses$Result$Rows.toString(Responses.java:427) at org.slf4j.helpers.MessageFormatter.safeObjectAppend(MessageFormatter.java:305) at org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:277) at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:231) at ch.qos.logback.classic.spi.LoggingEvent.getFormattedMessage(LoggingEvent.java:298) at ch.qos.logback.classic.spi.LoggingEvent.prepareForDeferredProcessing(LoggingEvent.java:208) at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) 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:273) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:260) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442) at ch.qos.logback.classic.Logger.filterAndLog_2(Logger.java:433) at ch.qos.logback.classic.Logger.trace(Logger.java:454) at com.datastax.driver.core.Connection$Dispatcher.messageReceived(Connection.java:671) at com.datastax.shaded.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at com.datastax.shaded.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at com.datastax.shaded.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at com.datastax.shaded.netty.channel.Channels.fireMessageReceived(Channels.java:296) at com.datastax.shaded.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70) at com.datastax.shaded.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at com.datastax.shaded.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at com.datastax.shaded.netty.channel.Channels.fireMessageReceived(Channels.java:296) at com.datastax.shaded.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) SLF4J: Failed toString() invocation on an object of type [com.datastax.driver.core.Responses$Result$Rows] java.lang.OutOfMemoryError: Java heap space {code}

    DataStax JIRA | 2 years ago | Massimo Celli
    java.lang.OutOfMemoryError: Java heap space
  3. 0

    Using the DataStax Java Driver, we've written code to stream in the contents of a table from DSE and combine it into a map. This works, but HashMap throws an OutOfMemoryException which is caught by SL4J. (see below) The cause of this exception seems to be TRACE logs of responses from Cassandra. We think that when logging is disabled, the responses are parsed with protocolVersion V2, and the hash table is allocated with 256 entries. When logging is enabled, the responses are parsed with protocolVersion V3 by the toString code, and the hash table is allocated with 16777236 entries. HashMap throws an OutOfMemoryException when it attempts to allocate the underlying array. The version of C* we use is 2.0.x (and thus is running on protocol version V2) {code} SLF4J: Failed toString() invocation on an object of type [com.datastax.driver.core.Responses$Result$Rows] java.lang.OutOfMemoryError: Java heap space at java.util.HashMap.<init>(HashMap.java:187) at java.util.LinkedHashMap.<init>(LinkedHashMap.java:160) at java.util.HashSet.<init>(HashSet.java:142) at java.util.LinkedHashSet.<init>(LinkedHashSet.java:129) at com.datastax.driver.core.TypeCodec$SetCodec.deserialize(TypeCodec.java:1073) at com.datastax.driver.core.TypeCodec$SetCodec.deserialize(TypeCodec.java:1001) at com.datastax.driver.core.DataType.deserialize(DataType.java:606) at com.datastax.driver.core.Responses$Result$Rows.toString(Responses.java:427) at org.slf4j.helpers.MessageFormatter.safeObjectAppend(MessageFormatter.java:305) at org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:277) at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:231) at ch.qos.logback.classic.spi.LoggingEvent.getFormattedMessage(LoggingEvent.java:298) at ch.qos.logback.classic.spi.LoggingEvent.prepareForDeferredProcessing(LoggingEvent.java:208) at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) 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:273) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:260) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442) at ch.qos.logback.classic.Logger.filterAndLog_2(Logger.java:433) at ch.qos.logback.classic.Logger.trace(Logger.java:454) at com.datastax.driver.core.Connection$Dispatcher.messageReceived(Connection.java:671) at com.datastax.shaded.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at com.datastax.shaded.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at com.datastax.shaded.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at com.datastax.shaded.netty.channel.Channels.fireMessageReceived(Channels.java:296) at com.datastax.shaded.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70) at com.datastax.shaded.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at com.datastax.shaded.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at com.datastax.shaded.netty.channel.Channels.fireMessageReceived(Channels.java:296) at com.datastax.shaded.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) SLF4J: Failed toString() invocation on an object of type [com.datastax.driver.core.Responses$Result$Rows] java.lang.OutOfMemoryError: Java heap space {code}

    DataStax JIRA | 2 years ago | Massimo Celli
    java.lang.OutOfMemoryError: Java heap space
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    OutOfMemory Exception : java heap space

    Google Groups | 6 months ago | deepak singh
    java.lang.OutOfMemoryError: Java heap space* *java.lang.OutOfMemoryError: Java heap space*
  6. 0

    OutOfMemory Exception : java heap space

    Google Groups | 6 months ago | deepak singh
    java.lang.OutOfMemoryError: Java heap space* *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.HashMap.<init>()
    2. Java RT
      LinkedHashSet.<init>
      1. java.util.HashMap.<init>(Unknown Source)
      2. java.util.LinkedHashMap.<init>(Unknown Source)
      3. java.util.HashSet.<init>(Unknown Source)
      4. java.util.LinkedHashSet.<init>(Unknown Source)
      4 frames