Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion native-engine/auron-jni-bridge/src/jni_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ pub struct AuronOnHeapSpillManager<'a> {
pub method_releaseSpill_ret: ReturnType,
}
impl<'a> AuronOnHeapSpillManager<'a> {
pub const SIG_TYPE: &'static str = "org/apache/spark/sql/auron/memory/SparkOnHeapSpillManager";
pub const SIG_TYPE: &'static str = "org/apache/auron/memory/OnHeapSpillManager";

pub fn new(env: &JNIEnv<'a>) -> JniResult<AuronOnHeapSpillManager<'a>> {
let class = get_global_jclass(env, Self::SIG_TYPE)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ object SparkOnHeapSpillManager extends Logging {

def current: OnHeapSpillManager = {
val tc = TaskContext.get
all.getOrElseUpdate(tc.taskAttemptId(), new SparkOnHeapSpillManager(tc))
if (tc != null) {
all.getOrElseUpdate(tc.taskAttemptId(), new SparkOnHeapSpillManager(tc))
} else {
OnHeapSpillManager.getDisabledOnHeapSpillManager
}
Comment on lines +198 to +202
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OnHeapSpillManager.getDisabledOnHeapSpillManager() creates a new anonymous instance on each call (see auron-core/.../OnHeapSpillManager.java). Since current may be called repeatedly on the driver (where TaskContext.get == null), consider caching a single disabled manager instance in SparkOnHeapSpillManager (e.g., a private val) and returning that to avoid unnecessary allocations/GC churn.

Copilot uses AI. Check for mistakes.
}
}
Loading