因为java,我的spark工作失败了。lang.OutOfMemoryError:Java堆空间。
我试着玩配置参数,比如
executor-cores
,则,
executor-memory
,则,
num-executors
,则,
driver-cores
,则,
driver-memory
,则,
spark.yarn.driver.memoryOverhead
,则,
spark.yarn.executor.memoryOverhead
根据
Ramzy's answer
.下面是我的配置集
--master yarn-cluster --executor-cores 4 --executor-memory 10G --num-executors 30 --driver-cores 4 --driver-memory 16G --queue team_high --conf spark.eventLog.dir=hdfs:///spark-history --conf spark.eventLog.enabled=true --conf spark.yarn.historyServer.address=xxxxxxxxx:xxxx --conf spark.sql.tungsten.enabled=true --conf spark.ui.port=5051 --conf spark.sql.shuffle.partitions=30 --conf spark.yarn.driver.memoryOverhead=1024 --conf spark.yarn.executor.memoryOverhead=1400 --conf spark.dynamicAllocation.enabled=true --conf spark.shuffle.service.enabled=true --conf spark.sql.orc.filterPushdown=true --conf spark.scheduler.mode=FAIR --conf hive.exec.dynamic.partition=false --conf hive.exec.dynamic.partition.mode=nonstrict --conf mapreduce.fileoutputcommitter.algorithm.version=2 --conf orc.stripe.size=67108864 --conf hive.merge.orcfile.stripe.level=true --conf hive.merge.smallfiles.avgsize=2560000 --conf hive.merge.size.per.task=2560000 --conf spark.driver.extraJavaOptions='-XX:+UseCompressedOops -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps' --conf spark.executor.extraJavaOptions='-XX:+UseCompressedOops -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC'
对于上述问题,它有时有效,但多数情况下失败。
调试时,我发现了以下GC日志。有人能帮我理解这些日志并帮我调整这项工作吗?
#
# java.lang.OutOfMemoryError: Java heap space
# -XX:OnOutOfMemoryError="kill %p"
# Executing /bin/sh -c "kill 79911"...
Heap
PSYoungGen total 2330112K, used 876951K [0x00000006eab00000, 0x00000007c0000000, 0x00000007c0000000)
eden space 1165312K, 75% used [0x00000006eab00000,0x0000000720365f50,0x0000000731d00000)
from space 1164800K, 0% used [0x0000000731d00000,0x0000000731d00000,0x0000000778e80000)
to space 1164800K, 0% used [0x0000000778e80000,0x0000000778e80000,0x00000007c0000000)
ParOldGen total 6990848K, used 6990706K [0x0000000540000000, 0x00000006eab00000, 0x00000006eab00000)
object space 6990848K, 99% used [0x0000000540000000,0x00000006eaadc9c0,0x00000006eab00000)
Metaspace used 69711K, capacity 70498K, committed 72536K, reserved 1112064K
class space used 9950K, capacity 10182K, committed 10624K, reserved 1048576K
End of LogType:stdout