You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "dafeiw (via GitHub)" <gi...@apache.org> on 2023/06/07 09:53:00 UTC

[GitHub] [arrow] dafeiw opened a new issue, #35960: [Java] Accounted size went negative when locallyHeldMemory overflow

dafeiw opened a new issue, #35960:
URL: https://github.com/apache/arrow/issues/35960

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   The following code will throw `Accounted size went negative` exception.
   The buffer allocator `a` will ask its parent allocator to do allocation, however the `locallyHeldMemory` of parent allocator already reaches `Long.MAX_VALUE` when creating child actor `ChildB`
   
   ```
           RootAllocator parentAllocator  = new RootAllocator();
           BufferAllocator a = parentAllocator.newChildAllocator("ChildA", 0, Long.MAX_VALUE);
           BufferAllocator b = parentAllocator.newChildAllocator("ChildB", Long.MAX_VALUE, Long.MAX_VALUE);
           IntVector intVector = new IntVector("intVector", a);
           intVector.allocateNew(1);
           intVector.set(0, 2);
           intVector.setValueCount(1);
   
           IntVector intVector2 = new IntVector("intVector2", a);
           intVector2.allocateNew(1);
           intVector2.set(0, 2);
           intVector2.setValueCount(1);
   
           intVector.close();
           intVector2.close();
           a.close();
           b.close();
   ```
   
   ### Component(s)
   
   Java


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

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


[GitHub] [arrow] lidavidm closed issue #35960: [Java] Accounted size went negative when locallyHeldMemory overflow

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #35960: [Java] Accounted size went negative when locallyHeldMemory overflow
URL: https://github.com/apache/arrow/issues/35960


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

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


[GitHub] [arrow] lidavidm commented on issue #35960: [Java] Accounted size went negative when locallyHeldMemory overflow

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #35960:
URL: https://github.com/apache/arrow/issues/35960#issuecomment-1582507207

   Thanks! It seems likely there's an underflow or overflow here. (I'm curious why it lets you allocate from `a` in the first place, so I'll dig into that too; there's an "overlimit" situation but AFAIK it only applies when transferring buffers between allocators)


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