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


##########
datafusion/execution/src/memory_pool/pool.rs:
##########
@@ -54,7 +58,44 @@ impl MemoryPool for UnboundedMemoryPool {
 #[derive(Debug)]
 pub struct GreedyMemoryPool {
     pool_size: usize,
-    used: AtomicUsize,
+    meta: Mutex<SimplePool>,
+}
+
+// Simple struct that tracks memory usage across multiple consumers.
+// Can be used in composition with other fields for providing more 
sophisticated memory pool
+// policies
+#[derive(Debug, Default)]
+struct SimplePool {
+    // Maps consumer names to the amount of memory they use.
+    pool_members: HashMap<String, usize>,
+    // The total memory usage of all consumers.
+    total_size: usize,

Review Comment:
   ✅



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