This is an automated email from the ASF dual-hosted git repository.

feiwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 634343e20 [CELEBORN-2007] Reduce PartitionLocation memory usage
634343e20 is described below

commit 634343e2001fd3f004e245c56cbe9d45f2db1daf
Author: sychen <[email protected]>
AuthorDate: Thu May 22 17:20:58 2025 -0700

    [CELEBORN-2007] Reduce PartitionLocation memory usage
    
    ### What changes were proposed in this pull request?
    
    ### Why are the changes needed?
    Driver may have a large number of `PartitionLocation` objects, reducing 
some unnecessary fields of `PartitionLocation` can reduce the memory pressure 
of Driver.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    GA
    
    Closes #3274 from cxzl25/CELEBORN-2007.
    
    Authored-by: sychen <[email protected]>
    Signed-off-by: Wang, Fei <[email protected]>
---
 .../org/apache/celeborn/common/protocol/PartitionLocation.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/common/src/main/java/org/apache/celeborn/common/protocol/PartitionLocation.java
 
b/common/src/main/java/org/apache/celeborn/common/protocol/PartitionLocation.java
index 8e76f3488..46316d8bd 100644
--- 
a/common/src/main/java/org/apache/celeborn/common/protocol/PartitionLocation.java
+++ 
b/common/src/main/java/org/apache/celeborn/common/protocol/PartitionLocation.java
@@ -78,8 +78,6 @@ public class PartitionLocation implements Serializable {
     this.peer = loc.peer;
     this.storageInfo = loc.storageInfo;
     this.mapIdBitMap = loc.mapIdBitMap;
-    this._hostPushPort = host + ":" + pushPort;
-    this._hostFetchPort = host + ":" + fetchPort;
   }
 
   public PartitionLocation(
@@ -152,8 +150,6 @@ public class PartitionLocation implements Serializable {
     this.peer = peer;
     this.storageInfo = hint;
     this.mapIdBitMap = mapIdBitMap;
-    this._hostPushPort = host + ":" + pushPort;
-    this._hostFetchPort = host + ":" + fetchPort;
   }
 
   public int getId() {
@@ -210,10 +206,16 @@ public class PartitionLocation implements Serializable {
   }
 
   public String hostAndFetchPort() {
+    if (_hostFetchPort == null) {
+      _hostFetchPort = host + ":" + fetchPort;
+    }
     return _hostFetchPort;
   }
 
   public String hostAndPushPort() {
+    if (_hostPushPort == null) {
+      _hostPushPort = host + ":" + pushPort;
+    }
     return _hostPushPort;
   }
 

Reply via email to