Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-47000][CORE] Use getTotalMemorySize in WorkerArguments #45060

Closed
wants to merge 1 commit into from

Conversation

dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Feb 7, 2024

What changes were proposed in this pull request?

This PR aims to use getTotalMemorySize instead of deprecated getTotalPhysicalMemorySize (OpenJDK) or getTotalPhysicalMemory (IBM Java) in WorkerArguments.

Why are the changes needed?

getTotalPhysicalMemorySize is deprecated at Java 14 in OpenJDK.

getTotalPhysicalMemory is deprecated since 1.8 in IBM.

getTotalMemorySize is recommended in both environments for Apache Spark 4.0.0 because the minimum Java version is 17.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pass the CIs with the existing test cases.

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

No.

@github-actions github-actions bot added the CORE label Feb 7, 2024
@dongjoon-hyun
Copy link
Member Author

core passed.
Screenshot 2024-02-07 at 11 45 23 AM

Could you review this when you have some time, @sunchao ?

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

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

LGTM

@dongjoon-hyun
Copy link
Member Author

Thank you , @sunchao !

@dongjoon-hyun dongjoon-hyun deleted the SPARK-47000 branch February 7, 2024 22:33
@dongjoon-hyun
Copy link
Member Author

All tests passed. Merged to master for Apache Spark 4.0.0.

snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Mar 26, 2024
### What changes were proposed in this pull request?

This PR aims to use `getTotalMemorySize` instead of deprecated `getTotalPhysicalMemorySize` (OpenJDK) or `getTotalPhysicalMemory` (IBM Java) in `WorkerArguments`.

### Why are the changes needed?

`getTotalPhysicalMemorySize` is deprecated at Java 14 in OpenJDK.
- https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getTotalPhysicalMemorySize()

`getTotalPhysicalMemory` is deprecated since 1.8 in IBM.
- https://eclipse.dev/openj9/docs/api/jdk17/jdk.management/com/ibm/lang/management/OperatingSystemMXBean.html#getTotalPhysicalMemory()

`getTotalMemorySize` is recommended in both environments for Apache Spark 4.0.0 because the minimum Java version is 17.

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

No.

### How was this patch tested?

Pass the CIs with the existing test cases.

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

No.

Closes apache#45060 from dongjoon-hyun/SPARK-47000.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
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.

2 participants