[
https://issues.apache.org/jira/browse/DRILL-5927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449332#comment-16449332
]
ASF GitHub Bot commented on DRILL-5927:
---------------------------------------
Github user ilooner commented on a diff in the pull request:
https://github.com/apache/drill/pull/1234#discussion_r183611338
--- Diff:
exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java
---
@@ -49,17 +50,20 @@
import org.junit.BeforeClass;
import org.junit.Test;
-public class TestBsonRecordReader extends BaseTestQuery {
+public class TestBsonRecordReader {
+ private static BufferAllocator allocator;
private static VectorContainerWriter writer;
private static TestOutputMutator mutator;
+ private static DrillBuf buffer;
private static BsonRecordReader bsonReader;
@BeforeClass
public static void setUp() {
- BufferAllocator bufferAllocator = getDrillbitContext().getAllocator();
- mutator = new TestOutputMutator(bufferAllocator);
+ allocator = new RootAllocator(100_000_000);
--- End diff --
After testing just now, the lowest I could push this was 9,000,000 bytes.
Going to 8,000,000 bytes causes an OOM. It looks like the BsonRecordReader
allocates a bunch of value vectors. I will adjust this to 9,000,000.
```
org.apache.drill.exec.exception.OutOfMemoryException: Unable to allocate
buffer of size 8192 due to memory limit (800000). Current allocation: 795648
at
org.apache.drill.exec.memory.BaseAllocator.buffer(BaseAllocator.java:236)
at
org.apache.drill.exec.memory.BaseAllocator.buffer(BaseAllocator.java:211)
at
org.apache.drill.exec.vector.UInt1Vector.reallocRaw(UInt1Vector.java:262)
at
org.apache.drill.exec.vector.UInt1Vector.reAlloc(UInt1Vector.java:251)
at
org.apache.drill.exec.vector.UInt1Vector$Mutator.setSafe(UInt1Vector.java:480)
at
org.apache.drill.exec.vector.NullableVarCharVector$Mutator.setSafe(NullableVarCharVector.java:608)
at
org.apache.drill.exec.vector.complex.impl.NullableVarCharWriterImpl.write(NullableVarCharWriterImpl.java:110)
at
org.apache.drill.exec.store.bson.BsonRecordReader.writeString(BsonRecordReader.java:276)
at
org.apache.drill.exec.store.bson.BsonRecordReader.writeBinary(BsonRecordReader.java:205)
at
org.apache.drill.exec.store.bson.BsonRecordReader.writeToListOrMap(BsonRecordReader.java:117)
at
org.apache.drill.exec.store.bson.BsonRecordReader.write(BsonRecordReader.java:75)
at
org.apache.drill.exec.store.bson.TestBsonRecordReader.testBinaryTypes(TestBsonRecordReader.java:244)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:498)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
```
> Root allocator consistently Leaks a buffer in unit tests
> --------------------------------------------------------
>
> Key: DRILL-5927
> URL: https://issues.apache.org/jira/browse/DRILL-5927
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Timothy Farkas
> Assignee: Timothy Farkas
> Priority: Minor
> Fix For: 1.14.0
>
>
> TestBsonRecordReader consistently poduces this exception when running on my
> laptop
> {code}
> 13:09:15.777 [main] ERROR o.a.d.exec.server.BootStrapContext - Error while
> closing
> java.lang.IllegalStateException: Allocator[ROOT] closed with outstanding
> buffers allocated (1).
> Allocator(ROOT) 0/1024/10113536/4294967296 (res/actual/peak/limit)
> child allocators: 0
> ledgers: 1
> ledger[79] allocator: ROOT), isOwning: true, size: 1024, references: 1,
> life: 340912804170064..0, allocatorManager: [71, life: 340912803759189..0]
> holds 1 buffers.
> DrillBuf[106], udle: [72 0..1024]
> reservations: 0
> at
> org.apache.drill.exec.memory.BaseAllocator.close(BaseAllocator.java:502)
> ~[classes/:na]
> at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:76)
> [classes/:na]
> at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:64)
> [classes/:na]
> at
> org.apache.drill.exec.server.BootStrapContext.close(BootStrapContext.java:256)
> ~[classes/:na]
> at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:76)
> [classes/:na]
> at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:64)
> [classes/:na]
> at org.apache.drill.exec.server.Drillbit.close(Drillbit.java:205)
> [classes/:na]
> at org.apache.drill.BaseTestQuery.closeClient(BaseTestQuery.java:315)
> [test-classes/:na]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[na:1.8.0_144]
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> ~[na:1.8.0_144]
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.8.0_144]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> [junit-4.11.jar:na]
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> [junit-4.11.jar:na]
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> [junit-4.11.jar:na]
> at
> mockit.integration.junit4.internal.JUnit4TestRunnerDecorator.invokeExplosively(JUnit4TestRunnerDecorator.java:44)
> [jmockit-1.3.jar:na]
> at
> mockit.integration.junit4.internal.MockFrameworkMethod.invokeExplosively(MockFrameworkMethod.java:29)
> [jmockit-1.3.jar:na]
> at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source) ~[na:na]
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.8.0_144]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
> at
> mockit.internal.util.MethodReflection.invokeWithCheckedThrows(MethodReflection.java:95)
> [jmockit-1.3.jar:na]
> at
> mockit.internal.annotations.MockMethodBridge.callMock(MockMethodBridge.java:76)
> [jmockit-1.3.jar:na]
> at
> mockit.internal.annotations.MockMethodBridge.invoke(MockMethodBridge.java:41)
> [jmockit-1.3.jar:na]
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java)
> [junit-4.11.jar:na]
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
> [junit-4.11.jar:na]
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> [junit-4.11.jar:na]
> at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> [junit-4.11.jar:na]
> at
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
> [junit-rt.jar:na]
> at
> com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
> [junit-rt.jar:na]
> at
> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
> [junit-rt.jar:na]
> at
> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
> [junit-rt.jar:na]
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)