shfshihuafeng opened a new pull request, #2900:
URL: https://github.com/apache/drill/pull/2900

   # [DRILL-8488](https://issues.apache.org/jira/browse/DRILL-8488): 
HashJoinPOP memory leak is caused by  OutOfMemoryException
   
   (Please replace `PR Title` with actual PR Title)
   
   ## Description
   
   We should catch the OutOfMemoryException instead of OutOfMemoryError
   
   ```
    public DrillBuf buffer(final int initialRequestSize, BufferManager manager) 
{
       assertOpen();
   
       Preconditions.checkArgument(initialRequestSize >= 0, "the requested size 
must be non-negative");
   
       if (initialRequestSize == 0) {
         return empty;
       }
   
       // round to next largest power of two if we're within a chunk since that 
is how our allocator operates
       final int actualRequestSize = initialRequestSize < CHUNK_SIZE ?
           nextPowerOfTwo(initialRequestSize)
           : initialRequestSize;
       AllocationOutcome outcome = allocateBytes(actualRequestSize);
       if (!outcome.isOk()) {
         **throw new OutOfMemoryException**(createErrorMsg(this, 
actualRequestSize, initialRequestSize));
       }
   }
   ```
   
   ## Documentation
   (Please describe user-visible changes similar to what should appear in the 
Drill documentation.)
   
   ## Testing
   [drill-848](https://issues.apache.org/jira/browse/DRILL-8485))
   


-- 
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: dev-unsubscr...@drill.apache.org

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

Reply via email to