You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/03/18 00:23:09 UTC

[GitHub] [hudi] alexeykudinkin commented on a change in pull request #5060: [HUDI-3652] use threadlocal to decrease ObjectSizeCalculator memory use

alexeykudinkin commented on a change in pull request #5060:
URL: https://github.com/apache/hudi/pull/5060#discussion_r829607531



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/util/ObjectSizeCalculator.java
##########
@@ -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));

Review comment:
       Let's bubble this up to the top of the declarations list (where all the static members are)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org