-
Notifications
You must be signed in to change notification settings - Fork 558
[Core] Support Jvm memory shrinking for DynamicOffHeapSizingMemoryTarget #9585
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
Thanks for opening a pull request! Could you open an issue for this pull request on Github Issues? https://github.com/apache/incubator-gluten/issues Then could you also rename commit message and pull request title in the following format?
See also: |
Run Gluten Clickhouse CI on x86 |
cc @FelixYBW and @zhztheplayer , thanks. |
Run Gluten Clickhouse CI on x86 |
Thank you for iterating this feature! Curious, are there any future plans on the feature from your end? Or this is the final revision? |
From a functionality standpoint, this covers everything for now. We may add some monitoring and debugging improvements later, and adjust the strategies used based on customer feedback. |
Run Gluten Clickhouse CI on x86 |
Run Gluten Clickhouse CI on x86 |
1 similar comment
Run Gluten Clickhouse CI on x86 |
Is there some thing wrong with the build pipeline? cc @zhouyuan and @FelixYBW
|
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.
Haven't got time to take a closer look on this but feel free to merge if you are confident.
By the way, it feels we'd have basic spilling support for the feature to make it usable? Any thoughts on that?
Thanks for pointing this out. Through testing I found that with this PR the spill logic is still functioning. In our tests we observed that once the dynamic memory manager frees enough JVM memory, if the native task still needs more memory, spilling will be triggered as expected. |
Run Gluten Clickhouse CI on x86 |
Thanks for the inputs. I thought the feature would not trigger spill correctly since it was not reporting the usage to Spark (Spark triggers Velox spilling), maybe I missed something there. Will have a look once available. (non-blocking) |
Run Gluten Clickhouse CI on x86 |
This PR previously missed a change: when this feature is enabled, the memory allocations that Gluten reports to Spark should be counted against the ON_HEAP quota rather than OFF_HEAP. From my understanding, this change is the key for this feature to report memory usage correctly; with it, spilling will work as expected. |
Run Gluten Clickhouse CI on x86 |
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! I just learned more details on this feature
...-core/src/main/java/org/apache/gluten/memory/memtarget/DynamicOffHeapSizingMemoryTarget.java
Show resolved
Hide resolved
backends-velox/src/test/scala/org/apache/gluten/execution/DynamicOffHeapSizingSuite.scala
Show resolved
Hide resolved
...-core/src/main/java/org/apache/gluten/memory/memtarget/DynamicOffHeapSizingMemoryTarget.java
Show resolved
Hide resolved
...-core/src/main/java/org/apache/gluten/memory/memtarget/DynamicOffHeapSizingMemoryTarget.java
Show resolved
Hide resolved
Run Gluten Clickhouse CI on x86 |
Run Gluten Clickhouse CI on x86 |
Run Gluten Clickhouse CI on x86 |
Run Gluten Clickhouse CI on x86 |
Run Gluten Clickhouse CI on x86 |
Run Gluten Clickhouse CI on x86 |
Run Gluten Clickhouse CI on x86 |
What changes were proposed in this pull request?
Support Jvm memory shrinking for DynamicOffHeapSizingMemoryTarget
When a memory request cannot be satisfied, we first lower the value of option MaxHeapFreeRatio and trigger a full GC to force the JVM to return as much memory as possible back to the operating system. This approach incurs the overhead of a full GC each time.
Currently, only Java 11 and Java 17 are supported. And this has only been validated with the G1 GC.
Config
JVM memory shrinking