liuzqt commented on code in PR #47776:
URL: https://github.com/apache/spark/pull/47776#discussion_r1719383471


##########
core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java:
##########
@@ -122,6 +122,30 @@ public class TaskMemoryManager {
    */
   private volatile long acquiredButNotUsed = 0L;
 
+  /**
+   * Current off heap memory usage by this task.
+   */
+  private long currentOffHeapMemory = 0L;
+
+  private final Object offHeapMemoryLock = new Object();
+
+  /*
+   * Current on heap memory usage by this task.
+   */
+  private long currentOnHeapMemory = 0L;

Review Comment:
   Do you mean `memoryManager.getOffHeapExecutionMemoryUsageForTask` ? That was 
the [original 
implementation](https://github.com/apache/spark/pull/47192/commits/8cec467fb563b3e8cef5d7281665f5db19a3786d#diff-dd7c6261f4882a0c8d5369ac960267154f7f4dde991f491311f22e249586e35bL218),
 but that require synchronization on `MemoryManager` granularity, so we decided 
to maintain this on `TaskMemoryManager` level (see this [discussion 
thread](https://github.com/apache/spark/pull/47192#discussion_r1678527386))



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