[Java] How to use RootAllocator in a low memory setting?
- Dominant language
- Java
- Stars
- 94
- Forks
- 152
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 11
Description
When I run this simple code with JVM setting: "-Xmx64m"
```java
package com.snowflake;
import org.apache.arrow.memory.RootAllocator;
public class TestArrow
{
public static void main(String args[]) throws Exception
{
new RootAllocator(Integer.MAX_VALUE);
}
}
```
and got the following error
```java
Picked up JAVA_TOOL_OPTIONS: -Djavax.net.ssl.trustStore=/etc/pki/ca-trust/extracted/java/cacerts
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.arrow.memory.BaseAllocator.createEmpty(BaseAllocator.java:263)
at org.apache.arrow.memory.BaseAllocator.(BaseAllocator.java:89)
at org.apache.arrow.memory.RootAllocator.(RootAllocator.java:34)
at org.apache.arrow.memory.RootAllocator.(RootAllocator.java:30)
at com.snowflake.TestArrow.main(TestArrow.java:13)
Caused by: java.lang.NullPointerException
at io.netty.buffer.PooledByteBufAllocatorL$InnerAllocator.(PooledByteBufAllocatorL.java:145)
at io.netty.buffer.PooledByteBufAllocatorL.(PooledByteBufAllocatorL.java:49)
at org.apache.arrow.memory.AllocationManager.(AllocationManager.java:61) ... 5 more
Process finished with exit code 1
```
So how to use RootAllocator in such low memory case?
**Reporter**: [Andong Zhan](https://issues.apache.org/jira/browse/ARROW-6500)
**Note**: *This issue was originally created as [ARROW-6500](https://issues.apache.org/jira/browse/ARROW-6500). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Research direction
Start with the RootAllocator example using -Xmx64m and trace initialization through BaseAllocator.createEmpty, RootAllocator, and AllocationManager. Reproduce the ExceptionInInitializerError, then determine what behavior or guidance is needed for this low-memory configuration and verify it with the relevant allocator tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100