org.apache.spark.SparkException: Job aborted due to stage failure: Task 13 in stage 8821.0 failed 1 times, most recent failure: Lost task 13.0 in stage 8821.0 (TID 83708, localhost, executor driver): java.lang.OutOfMemoryError: Java heap space

Stack Overflow | Masha | 2 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to poroszd . Or join the community to write better ones.
  1. 0

    Pyspark out of memory exeption during model fit

    Stack Overflow | 2 months ago | Masha
    org.apache.spark.SparkException: Job aborted due to stage failure: Task 13 in stage 8821.0 failed 1 times, most recent failure: Lost task 13.0 in stage 8821.0 (TID 83708, localhost, executor driver): java.lang.OutOfMemoryError: Java heap space
  2. 0
    samebug tip
    You should use java.sql.Timestamp or Date to map BsonDateTime from mongodb.
  3. 0

    Re: java.util.NoSuchElementException: key not found

    apache.org | 1 year ago
    org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 5.0 failed 4 times, most recent failure: Lost task 0.3 in stage 5.0 (TID 76, slave2): java.util.NoSuchElementException: key not found: ruixue.sys.session.request > at scala.collection.MapLike$class.default(MapLike.scala:228) > at scala.collection.AbstractMap.default(Map.scala:58) > at scala.collection.mutable.HashMap.apply(HashMap.scala:64)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [SPARK-10422] String column in InMemoryColumnarCache needs to override clone method - ASF JIRA

    apache.org | 1 year ago
    org.apache.spark.SparkException: Job aborted due to stage failure: Task 1 in stage 0.0 failed 1 times, most recent failure: Lost task 1.0 in stage 0.0 (TID 1, localhost): java.util.NoSuchElementException: key not found: str_[0]
  6. 0

    We have a clone method in {{ColumnType}} (https://github.com/apache/spark/blob/v1.5.0-rc3/sql/core/src/main/scala/org/apache/spark/sql/columnar/ColumnType.scala#L103). Seems we need to override it for String (https://github.com/apache/spark/blob/v1.5.0-rc3/sql/core/src/main/scala/org/apache/spark/sql/columnar/ColumnType.scala#L314) because we are dealing with UTF8String. {code} val df = ctx.range(1, 30000).selectExpr("id % 500 as id").rdd.map(id => Tuple1(s"str_$id")).toDF("i") val cached = df.cache() cached.count() [info] - SPARK-10422: String column in InMemoryColumnarCache needs to override clone method *** FAILED *** (9 seconds, 152 milliseconds) [info] org.apache.spark.SparkException: Job aborted due to stage failure: Task 1 in stage 0.0 failed 1 times, most recent failure: Lost task 1.0 in stage 0.0 (TID 1, localhost): java.util.NoSuchElementException: key not found: str_[0] [info] at scala.collection.MapLike$class.default(MapLike.scala:228) [info] at scala.collection.AbstractMap.default(Map.scala:58) [info] at scala.collection.mutable.HashMap.apply(HashMap.scala:64) [info] at org.apache.spark.sql.columnar.compression.DictionaryEncoding$Encoder.compress(compressionSchemes.scala:258) [info] at org.apache.spark.sql.columnar.compression.CompressibleColumnBuilder$class.build(CompressibleColumnBuilder.scala:110) [info] at org.apache.spark.sql.columnar.NativeColumnBuilder.build(ColumnBuilder.scala:87) [info] at org.apache.spark.sql.columnar.InMemoryRelation$$anonfun$3$$anon$1$$anonfun$next$2.apply(InMemoryColumnarTableScan.scala:152) [info] at org.apache.spark.sql.columnar.InMemoryRelation$$anonfun$3$$anon$1$$anonfun$next$2.apply(InMemoryColumnarTableScan.scala:152) [info] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) [info] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) [info] at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) [info] at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) [info] at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) [info] at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:108) [info] at org.apache.spark.sql.columnar.InMemoryRelation$$anonfun$3$$anon$1.next(InMemoryColumnarTableScan.scala:152) [info] at org.apache.spark.sql.columnar.InMemoryRelation$$anonfun$3$$anon$1.next(InMemoryColumnarTableScan.scala:120) {code}

    Apache's JIRA Issue Tracker | 2 years ago | Yin Huai
    org.apache.spark.SparkException: Job aborted due to stage failure: Task 1 in stage 0.0 failed 1 times, most recent failure: Lost task 1.0 in stage 0.0 (TID 1, localhost): java.util.NoSuchElementException: key not found: str_[0]
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. org.apache.spark.SparkException

    Job aborted due to stage failure: Task 13 in stage 8821.0 failed 1 times, most recent failure: Lost task 13.0 in stage 8821.0 (TID 83708, localhost, executor driver): java.lang.OutOfMemoryError: Java heap space

    at java.nio.HeapByteBuffer.<init>()
  2. Java RT
    ByteBuffer.allocate
    1. java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
    2. java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
    2 frames
  3. org.apache.spark
    InMemoryRelation$$anonfun$1$$anon$1$$anonfun$next$2.apply
    1. org.apache.spark.sql.execution.columnar.NullableColumnBuilder$class.build(NullableColumnBuilder.scala:74)
    2. org.apache.spark.sql.execution.columnar.ComplexColumnBuilder.build(ColumnBuilder.scala:91)
    3. org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1$$anonfun$next$2.apply(InMemoryRelation.scala:134)
    4. org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1$$anonfun$next$2.apply(InMemoryRelation.scala:133)
    4 frames
  4. Scala
    ArrayOps$ofRef.map
    1. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
    2. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
    3. scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    4. scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
    5. scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
    6. scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:186)
    6 frames
  5. org.apache.spark
    PartiallyUnrolledIterator.next
    1. org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1.next(InMemoryRelation.scala:133)
    2. org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1.next(InMemoryRelation.scala:97)
    3. org.apache.spark.storage.memory.PartiallyUnrolledIterator.next(MemoryStore.scala:706)
    3 frames
  6. Spark
    RDD.computeOrReadCheckpoint
    1. org.apache.spark.serializer.SerializationStream.writeAll(Serializer.scala:140)
    2. org.apache.spark.serializer.SerializerManager.dataSerializeStream(SerializerManager.scala:170)
    3. org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1$$anonfun$apply$5.apply(BlockManager.scala:964)
    4. org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1$$anonfun$apply$5.apply(BlockManager.scala:963)
    5. org.apache.spark.storage.DiskStore.put(DiskStore.scala:57)
    6. org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:963)
    7. org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:947)
    8. org.apache.spark.storage.BlockManager.doPut(BlockManager.scala:887)
    9. org.apache.spark.storage.BlockManager.doPutIterator(BlockManager.scala:947)
    10. org.apache.spark.storage.BlockManager.getOrElseUpdate(BlockManager.scala:693)
    11. org.apache.spark.rdd.RDD.getOrCompute(RDD.scala:334)
    12. org.apache.spark.rdd.RDD.iterator(RDD.scala:285)
    13. org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
    14. org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
    15. org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
    16. org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
    17. org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
    17 frames