jhorstmann opened a new issue #503:
URL: https://github.com/apache/arrow-rs/issues/503


   **Describe the bug**
   The memory usage calculation for dictionary arrays seems to report twice the 
actual used memory.
   
   ```
   fn get_array_memory_size(&self) -> usize {
       self.data.get_array_memory_size()
           + self.keys.get_array_memory_size()
           + self.values.get_array_memory_size()
           + mem::size_of_val(self)
   }
   ```
   
   In the above code, `self.keys` and `self.values` are pointing to the same 
data that is in `self.data` and so would be counted twice.
   
   <!--
   **To Reproduce**
   Steps to reproduce the behavior:
   
   **Expected behavior**
   A clear and concise description of what you expected to happen.
   -->
   **Additional context**
   
   The memory usage calculation could actually work the same for all array 
types and could be implemented as a default method on the `Array` trait.
   
   
   


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