asimsedhain commented on code in PR #9015:
URL: https://github.com/apache/arrow-datafusion/pull/9015#discussion_r1487229118


##########
datafusion/execution/src/memory_pool/pool.rs:
##########
@@ -63,38 +72,89 @@ impl GreedyMemoryPool {
         debug!("Created new GreedyMemoryPool(pool_size={pool_size})");
         Self {
             pool_size,
-            used: AtomicUsize::new(0),
+            state: Mutex::new(GreedyMemoryPoolState {
+                pool_members: HashMap::new(),
+            }),
         }
     }
 }
 
 impl MemoryPool for GreedyMemoryPool {
-    fn grow(&self, _reservation: &MemoryReservation, additional: usize) {
-        self.used.fetch_add(additional, Ordering::Relaxed);
+    fn grow(&self, reservation: &MemoryReservation, additional: usize) {
+        let mut state = self.state.lock();
+        let used = state
+            .pool_members
+            .entry(reservation.consumer().name().into())

Review Comment:
   Changed to use hashbrown `HashMap`



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