-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRILL-8484: HashJoinPOP memory leak is caused by an oom exception wh… #2889
Conversation
for (ValueVector valueVector : vectorList) { | ||
valueVector.clear(); | ||
} | ||
throw UserException.memoryError(oom).message("Allocator memory failed").build(logger); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what would cause an error like this? If so what would the user need to do to fix this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we prepare to allocator memory using "allocator.buffer(dataLength)" for hashjoinPop allocator, if actual memory > maxAllocation(The parameter is calculated by call computeOperatorMemory) ,then it throw exception, like following my test。
user can adjust directMemory parameters (DRILL_MAX_DIRECT_MEMORY) or reduce concurrency based on actual conditions.
throw exception code
public DrillBuf buffer(final int initialRequestSize, BufferManager manager) {
assertOpen();
AllocationOutcome outcome = allocateBytes(actualRequestSize);
if (!outcome.isOk()) {
throw new OutOfMemoryException(createErrorMsg(this, actualRequestSize, initialRequestSize));
}
my test scenario
Caused by: org.apache.drill.exec.exception.OutOfMemoryException: Unable to allocate buffer of size 16384 (rounded from 14359) due to memory limit (41943040). Current allocation: 22583616
at org.apache.drill.exec.memory.BaseAllocator.buffer(BaseAllocator.java:241)
at org.apache.drill.exec.memory.BaseAllocator.buffer(BaseAllocator.java:216)
at org.apache.drill.exec.cache.VectorAccessibleSerializable.readFromStreamWithContainer(VectorAccessibleSerializable.java:172)
9d8bd3d
to
1f60467
Compare
@shfshihuafeng Can you please resolve merge conflicts. |
…n read data from Stream with container
1f60467
to
078b608
Compare
it is done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1
Thanks for this.
…n read data from Stream with container (apache#2889)
…n read data from Stream with container (#2889)
…en read data from Stream with container
DRILL-8484: HashJoinPOP memory leak is caused by an oom exception when read data from Stream with container
Description
when traversing fieldList druing read data from Stream with container , if the intermediate process throw exception,we can not release previously constructed vectors. it result in memory leak
Documentation
(Please describe user-visible changes similar to what should appear in the Drill documentation.)
Testing
You can add debugging code to reproduce this scenario as following
or
test tpch like DRILL-8483
(1) debug code
(2) run following sql (tpch8)
(3) you find memory leak ,but there is no sql