You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "hudi-bot (via GitHub)" <gi...@apache.org> on 2025/11/30 04:47:26 UTC

[I] use threadlocal to decrease ObjectSizeCalculator memory use [hudi]

hudi-bot opened a new issue, #15070:
URL: https://github.com/apache/hudi/issues/15070

   in class ObjectSizeCalculator
   
   everytime call static function getObjectSize will new ObjectSizeCalculator, cost much memory, Gc busy. use threadlocal will decrease memory use
   
    
   {code:java}
   /**
    * Given an object, returns the total allocated size, in bytes, of the object and all other objects reachable from it.
    * Attempts to to detect the current JVM memory layout, but may fail with {@link UnsupportedOperationException};
    *
    * @param obj the object; can be null. Passing in a {@link java.lang.Class} object doesn't do anything special, it
    *        measures the size of all objects reachable through it (which will include its class loader, and by
    *        extension, all other Class objects loaded by the same loader, and all the parent class loaders). It doesn't
    *        provide the size of the static fields in the JVM class that the Class object represents.
    * @return the total allocated size of the object and all other objects it retains.
    * @throws UnsupportedOperationException if the current vm memory layout cannot be detected.
    */
   public static long getObjectSize(Object obj) throws UnsupportedOperationException {
     return obj == null ? 0 : new ObjectSizeCalculator(CurrentLayout.SPEC).calculateObjectSize(obj);
   }  {code}
   
   ## JIRA info
   
   - Link: https://issues.apache.org/jira/browse/HUDI-3652
   - Type: Improvement


-- 
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.apache.org

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


Re: [I] use threadlocal to decrease ObjectSizeCalculator memory use [hudi]

Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan closed issue #15070: use threadlocal to decrease ObjectSizeCalculator memory use
URL: https://github.com/apache/hudi/issues/15070


-- 
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


Re: [I] use threadlocal to decrease ObjectSizeCalculator memory use [hudi]

Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan commented on issue #15070:
URL: https://github.com/apache/hudi/issues/15070#issuecomment-4795309823

   Closing as resolved. Tracked in [HUDI-3652](https://issues.apache.org/jira/browse/HUDI-3652). The change landed in PR [#5060](https://github.com/apache/hudi/pull/5060) (commit `f0ab4a6e9ef4`). Please reopen if you can still reproduce on the latest release.


-- 
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


Re: [I] use threadlocal to decrease ObjectSizeCalculator memory use [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on issue #15070:
URL: https://github.com/apache/hudi/issues/15070#issuecomment-3630141122

   ### Linked PR(s)
   
   - https://github.com/apache/hudi/pull/5060
   - https://github.com/apache/hudi/pull/5323


-- 
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