Skip to content

Conversation

@zhztheplayer
Copy link
Member

@zhztheplayer zhztheplayer commented Oct 31, 2025

What changes were proposed in this pull request?

The PR adds off-heap memory mode support for LongHashedRelation.

Why are the changes needed?

To avoid on-heap OOMs when user sets spark.memory.offHeap.enabled=true, and configures JVM with a comparatively small heap size.

Does this PR introduce any user-facing change?

When spark.memory.offHeap.enabled=true is set:

  • Required off-heap memory size may increase
  • Required on-heap memory size may decrease

How was this patch tested?

WIP

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the SQL label Oct 31, 2025
cloud-fan pushed a commit that referenced this pull request Nov 3, 2025
…nSuite

### What changes were proposed in this pull request?

Add the following code in `HashedRelationSuite`, to cover the API `HashedRelation#close` in the test suite.

```scala
  protected override def afterEach(): Unit = {
    super.afterEach()
    assert(umm.executionMemoryUsed === 0)
  }
```

### Why are the changes needed?

Doing this will:

1. Ensure `HashedRelation#close` is called in test code, to lower memory footprint and avoid memory leak when executing tests.
2. Ensure implementations of `HashedRelation#close` free the allocated memory blocks correctly.

It's an individual effort to improve the test quality, but also a prerequisite task for #52817.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

It's a test PR.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #52830 from zhztheplayer/wip-54132.

Authored-by: Hongze Zhang <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
cloud-fan pushed a commit that referenced this pull request Nov 3, 2025
…nSuite

### What changes were proposed in this pull request?

Add the following code in `HashedRelationSuite`, to cover the API `HashedRelation#close` in the test suite.

```scala
  protected override def afterEach(): Unit = {
    super.afterEach()
    assert(umm.executionMemoryUsed === 0)
  }
```

### Why are the changes needed?

Doing this will:

1. Ensure `HashedRelation#close` is called in test code, to lower memory footprint and avoid memory leak when executing tests.
2. Ensure implementations of `HashedRelation#close` free the allocated memory blocks correctly.

It's an individual effort to improve the test quality, but also a prerequisite task for #52817.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

It's a test PR.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #52830 from zhztheplayer/wip-54132.

Authored-by: Hongze Zhang <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit a5e866f)
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant