milenkovicm commented on issue #7858:
URL: 
https://github.com/apache/arrow-datafusion/issues/7858#issuecomment-1782579025

   Memory management is fun, still looking at it :)
   
   Two questions, first one 
   
   should `MemoryConsumer` for `GroupedHashAggregateStream` be 
`with_can_spill=true` ?
   
   
https://github.com/apache/arrow-datafusion/blob/a9d66e2b492843c2fb335a7dfe27fed073629b09/datafusion/physical-plan/src/aggregates/row_hash.rs#L331
   
   be: 
   
   ```rust
   let reservation = 
MemoryConsumer::new(name).with_can_spill(true).register(context.memory_pool());
   ```
   
   Second question, can `MemoryReservation` expose `consumer`? Reason being is 
that way we can create useful `MemoryManager` implementations which are not of 
datafusion crate
   
   ```rust
   impl MemoryReservation {
       
       pub fn consumer(&self) -> &MemoryConsumer {
           &self.registration.consumer
       }
   }
   ```
   


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