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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to