You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Dandandan (via GitHub)" <gi...@apache.org> on 2023/07/20 18:45:17 UTC

[GitHub] [arrow-datafusion] Dandandan commented on a diff in pull request #7041: Double RawTable on grow instead of triple

Dandandan commented on code in PR #7041:
URL: https://github.com/apache/arrow-datafusion/pull/7041#discussion_r1269840975


##########
datafusion/execution/src/memory_pool/proxy.rs:
##########
@@ -84,7 +84,7 @@ impl<T> RawTableAllocExt for RawTable<T> {
             Err(x) => {
                 // need to request more memory
 
-                let bump_elements = (self.capacity() * 2).max(16);
+                let bump_elements = self.capacity().max(16);
                 let bump_size = bump_elements * std::mem::size_of::<T>();
                 *accounting = (*accounting).checked_add(bump_size).expect("overflow");
 

Review Comment:
   Yeah this looks correct to međź‘Ť



##########
datafusion/execution/src/memory_pool/proxy.rs:
##########
@@ -84,7 +84,7 @@ impl<T> RawTableAllocExt for RawTable<T> {
             Err(x) => {
                 // need to request more memory
 
-                let bump_elements = (self.capacity() * 2).max(16);
+                let bump_elements = self.capacity().max(16);
                 let bump_size = bump_elements * std::mem::size_of::<T>();
                 *accounting = (*accounting).checked_add(bump_size).expect("overflow");
 

Review Comment:
   Yeah this looks correct to međź‘Ť



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org