-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[HUDI-3652] Make ObjectSizeCalculator threadlocal to reduce memory footprint #5060
[HUDI-3652] Make ObjectSizeCalculator threadlocal to reduce memory footprint #5060
Conversation
@sekaiga please format the description appropriately |
@@ -92,6 +92,7 @@ public static long getObjectSize(Object obj) throws UnsupportedOperationExceptio | |||
private final Set<Object> alreadyVisited = Collections.newSetFromMap(new IdentityHashMap<>()); | |||
private final Deque<Object> pending = new ArrayDeque<>(64); | |||
private long size; | |||
private static final ThreadLocal<ObjectSizeCalculator> objectSizeCalculator = ThreadLocal.withInitial(() -> new ObjectSizeCalculator(CurrentLayout.SPEC)); |
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.
Let's bubble this up to the top of the declarations list (where all the static members are)
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.
+1
2ca6120
to
0528eca
Compare
@hudi-bot run azure |
1 similar comment
@hudi-bot run azure |
@hudi-bot run azure |
@sekaiga can you please rebase master ? this is a small fix we can land for 0.11 |
hudi-common/src/main/java/org/apache/hudi/common/util/ObjectSizeCalculator.java
Outdated
Show resolved
Hide resolved
0528eca
to
b4f8265
Compare
b4f8265
to
421abaa
Compare
All checks have passed , please merge , thanks |
CI report:Bot commands@hudi-bot supports the following commands:
|
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.
LGTM
…otprint (#5060) Co-authored-by: zhouhuidong <[email protected]>
hey @sekaiga this patch seems to break in CI environment. https://dev.azure.com/apache-hudi-ci-org/apache-hudi-ci/_build/results?buildId=8070&view=results |
Tips
What is the purpose of the pull request
(For example: This pull request adds quick-start document.)
Brief change log
(for example:)
Verify this pull request
(Please pick either of the following options)
This pull request is a trivial rework / code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Committer checklist
Has a corresponding JIRA in PR title & commit
Commit message is descriptive of the change
CI is green
Necessary doc changes done or have another open PR
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.