zuston commented on code in PR #1531:
URL: 
https://github.com/apache/incubator-uniffle/pull/1531#discussion_r1493748730


##########
server/src/main/java/org/apache/uniffle/server/NettyDirectMemoryTracker.java:
##########
@@ -68,6 +74,9 @@ public void start() {
             
ShuffleServerMetrics.gaugeUsedDirectMemorySize.set(usedDirectMemory);
             
ShuffleServerMetrics.gaugeAllocatedDirectMemorySize.set(allocatedDirectMemory);
             
ShuffleServerMetrics.gaugePinnedDirectMemorySize.set(pinnedDirectMemory);
+            if (nettyServerEnabled) {
+              shuffleBufferManager.setUsedMemory(pinnedDirectMemory);

Review Comment:
   Emm... It's not a good design that use the scheduled thread to update 
usedMem, which is not determined.



##########
common/src/main/java/org/apache/uniffle/common/util/NettyUtils.java:
##########
@@ -132,4 +134,52 @@ private static PooledByteBufAllocator createAllocator() {
         0,
         PooledByteBufAllocator.defaultUseCacheForAllThreads());
   }
+
+  /**
+   * Calculate the allocated direct memory size based on the requested size.
+   *
+   * @param requestedSize The requested size of the direct memory.
+   * @return The estimated allocated direct memory size.
+   */
+  public static int calculateEstimatedMemoryAllocationSize(int requestedSize) {

Review Comment:
   It's really weird 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to