-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-53966][CORE] Add utility functions to detect JVM GCs #52678
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
Conversation
…ZGC and ON_HEAP are used
|
According to https://dev.java/learn/jvm/tool/garbage-collection/zgc-deepdive/
Seems the waste is not as bad as G1, but this change still benefits ZGC memory utilization. Have you used Shenandoah GC? According to #34846 (review), I think we should apply the same change to Shenandoah GC.
|
| */ | ||
| lazy val isZGC: Boolean = checkUseGC("UseZGC") | ||
|
|
||
| def checkUseGC(useGCObjectStr: String): Boolean = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review. For this PR, I will only add a function to detect GCs for G1, ZGC and ShenandoahGC
Hi, @pan3793, @dongjoon-hyun run the previous test with Test result:
Detail test result: https://gist.github.com/wankunde/6f3b6ed8abaa247307469ab5a4fae2bb |
For ZGC, if we allocate a 4MB long array, approximately Test ZGC with |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I manually verified. Merged to master for Apache Spark 4.1.0-preview3. |
### What changes were proposed in this pull request? This PR aims to support `isSerialGC` and `isParallelGC` additionally as a follow-up of the following PR. - #52678 ### Why are the changes needed? - To be exhaustive (up to Java 25 environment) - Note that `UseEpsilonGC` is excluded because it's not a production-purpose GC. ### Does this PR introduce _any_ user-facing change? No, these are new APIs. ### How was this patch tested? Pass the CIs and manual review. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #52708 from dongjoon-hyun/SPARK-53966. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Kousuke Saruta <[email protected]>
### What changes were proposed in this pull request? This PR aims to add utility functions to detect JVM GCs. ### Why are the changes needed? To provide a general capability to optimize based on the GC types. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Manual review. ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#52678 from wankunde/zgc. Authored-by: WanKun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
### What changes were proposed in this pull request? This PR aims to support `isSerialGC` and `isParallelGC` additionally as a follow-up of the following PR. - apache#52678 ### Why are the changes needed? - To be exhaustive (up to Java 25 environment) - Note that `UseEpsilonGC` is excluded because it's not a production-purpose GC. ### Does this PR introduce _any_ user-facing change? No, these are new APIs. ### How was this patch tested? Pass the CIs and manual review. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#52708 from dongjoon-hyun/SPARK-53966. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Kousuke Saruta <[email protected]>
What changes were proposed in this pull request?
This PR aims to add utility functions to detect JVM GCs.
Why are the changes needed?
To provide a general capability to optimize based on the GC types.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Manual review.
Was this patch authored or co-authored using generative AI tooling?
No