Skip to content

Commit

Permalink
Check memory offHeap enabled for CustomResourceProfileExec
Browse files Browse the repository at this point in the history
  • Loading branch information
wForget committed Mar 27, 2024
1 parent ae9e88f commit 1c7c8cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ case class CustomResourceProfileExec(child: SparkPlan) extends UnaryExecNode {
private val executorMemoryOverhead =
conf.getConf(FINAL_WRITE_STAGE_EXECUTOR_MEMORY_OVERHEAD)
.getOrElse(sparkContext.getConf.get("spark.executor.memoryOverhead", "1G"))
private val executorOffHeapMemory = conf.getConf(FINAL_WRITE_STAGE_EXECUTOR_OFF_HEAP_MEMORY)
private val executorOffHeapMemory =
if (sparkContext.getConf.getBoolean("spark.memory.offHeap.enabled", false)) {
conf.getConf(FINAL_WRITE_STAGE_EXECUTOR_OFF_HEAP_MEMORY)
} else {
None
}

override lazy val metrics: Map[String, SQLMetric] = {
val base = Map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ case class CustomResourceProfileExec(child: SparkPlan) extends UnaryExecNode {
private val executorMemoryOverhead =
conf.getConf(FINAL_WRITE_STAGE_EXECUTOR_MEMORY_OVERHEAD)
.getOrElse(sparkContext.getConf.get("spark.executor.memoryOverhead", "1G"))
private val executorOffHeapMemory = conf.getConf(FINAL_WRITE_STAGE_EXECUTOR_OFF_HEAP_MEMORY)
private val executorOffHeapMemory =
if (sparkContext.getConf.getBoolean("spark.memory.offHeap.enabled", false)) {
conf.getConf(FINAL_WRITE_STAGE_EXECUTOR_OFF_HEAP_MEMORY)
} else {
None
}

override lazy val metrics: Map[String, SQLMetric] = {
val base = Map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ case class CustomResourceProfileExec(child: SparkPlan) extends UnaryExecNode {
private val executorMemoryOverhead =
conf.getConf(FINAL_WRITE_STAGE_EXECUTOR_MEMORY_OVERHEAD)
.getOrElse(sparkContext.getConf.get("spark.executor.memoryOverhead", "1G"))
private val executorOffHeapMemory = conf.getConf(FINAL_WRITE_STAGE_EXECUTOR_OFF_HEAP_MEMORY)
private val executorOffHeapMemory =
if (sparkContext.getConf.getBoolean("spark.memory.offHeap.enabled", false)) {
conf.getConf(FINAL_WRITE_STAGE_EXECUTOR_OFF_HEAP_MEMORY)
} else {
None
}

override lazy val metrics: Map[String, SQLMetric] = {
val base = Map(
Expand Down

0 comments on commit 1c7c8cd

Please sign in to comment.