You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "haohuaijin (via GitHub)" <gi...@apache.org> on 2024/09/23 05:23:06 UTC

[PR] fix: overestimating memory size in buffer [arrow-rs]

haohuaijin opened a new pull request, #6438:
URL: https://github.com/apache/arrow-rs/pull/6438

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #6363 
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   see https://github.com/apache/arrow-rs/issues/6363#issuecomment-2366788331
   # What changes are included in this PR?
   
   change the capacity function in `Buffer`
   from 
   ```
   self.data.capacity()
   ```
   to
   ```
   self.length + self.data.capacity() - self.data.len()
   ```
   
   # Are there any user-facing changes?
   
   maybe no
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


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


Re: [PR] fix: overestimating memory size in buffer [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #6438:
URL: https://github.com/apache/arrow-rs/pull/6438#issuecomment-2372053031

   Convert to draft while we discuss the options


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


Re: [PR] fix: overestimating memory size in buffer [arrow-rs]

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #6438:
URL: https://github.com/apache/arrow-rs/pull/6438#issuecomment-2367426442

   This is changing what these methods report to something else that I'm not sure is correct. Whilst this formulation may benefit your use-case, there are common situations where it will now under report...
   
   Perhaps you might file a ticket to discuss a memory tracking approach that better handles shared buffers, as that is the actual issue here


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


Re: [PR] fix: overestimating memory size in buffer [arrow-rs]

Posted by "haohuaijin (via GitHub)" <gi...@apache.org>.
haohuaijin commented on PR #6438:
URL: https://github.com/apache/arrow-rs/pull/6438#issuecomment-2367497593

   Thanks for your reply, @tustvold. I created a new issue, https://github.com/apache/arrow-rs/issues/6439, to discuss this.


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


Re: [PR] fix: overestimating memory size in buffer [arrow-rs]

Posted by "haohuaijin (via GitHub)" <gi...@apache.org>.
haohuaijin commented on code in PR #6438:
URL: https://github.com/apache/arrow-rs/pull/6438#discussion_r1770789028


##########
arrow-array/src/array/mod.rs:
##########
@@ -1026,17 +1026,6 @@ mod tests {
         );
     }
 
-    #[test]
-    fn test_memory_size_primitive_sliced() {
-        let arr = PrimitiveArray::<Int64Type>::from_iter_values(0..128);
-        let slice1 = arr.slice(0, 64);
-        let slice2 = arr.slice(64, 64);
-
-        // both slices report the full buffer memory usage, even though the buffers are shared

Review Comment:
   because current slice1 and sclic2 not return full buffer memory usage, so delete it.



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


Re: [PR] fix: overestimating memory size in buffer [arrow-rs]

Posted by "haohuaijin (via GitHub)" <gi...@apache.org>.
haohuaijin closed pull request #6438: fix: overestimating memory size in buffer
URL: https://github.com/apache/arrow-rs/pull/6438


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