viirya commented on code in PR #40043:
URL: https://github.com/apache/arrow/pull/40043#discussion_r1488753268
##########
java/vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthVector.java:
##########
@@ -476,11 +507,12 @@ private void allocateBytes(final long valueBufferSize,
final int valueCount) {
}
/* allocate offset buffer */
- private void allocateOffsetBuffer(final long size) {
+ private ArrowBuf allocateOffsetBuffer(final long size) {
Review Comment:
> > Now the created one value buffer only has one ref count for imported
side.
>
> I've gone over this: when a buffer is allocated, it starts with a refcount
of 1. As you yourself pointed out, exporting it increases the refcount. And
when the consumer calls the release callback, the refcount is only decreased by
1. So the refcount does not reach 0.
> This works for the other buffers of the vector because the vector holds
the buffer, so when the vector itself is closed it decrements the refcounts of
the buffers, so they reach 0. But for the buffer which we allocate on the fly
here, that is not true.
Hmm, don't you see my latest commit? It doesn't increase ref count when
exporting.
Or I miss anything?
--
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]