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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]