Skip to content

Commit b5e8316

Browse files
authored
fix: skip calculating per-task memory limit when in off-heap mode (#2462)
1 parent 87c750d commit b5e8316

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spark/src/main/scala/org/apache/comet/CometExecIterator.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ class CometExecIterator(
9393
}
9494
val protobufSparkConfigs = builder.build().toByteArray
9595

96+
val memoryLimitPerTask = if (offHeapMode) {
97+
// this per-task limit is not used in native code when using unified memory
98+
// so we can skip calculating it and avoid logging irrelevant information
99+
0
100+
} else {
101+
getMemoryLimitPerTask(conf)
102+
}
103+
96104
nativeLib.createPlan(
97105
id,
98106
cometBatchIterators,
@@ -107,7 +115,7 @@ class CometExecIterator(
107115
offHeapMode,
108116
memoryPoolType = COMET_EXEC_MEMORY_POOL_TYPE.get(),
109117
memoryLimit,
110-
memoryLimitPerTask = getMemoryLimitPerTask(conf),
118+
memoryLimitPerTask,
111119
taskAttemptId = TaskContext.get().taskAttemptId,
112120
debug = COMET_DEBUG_ENABLED.get(),
113121
explain = COMET_EXPLAIN_NATIVE_ENABLED.get(),

0 commit comments

Comments
 (0)