odraese commented on a change in pull request #626: [HIVE-21686] ensure that 
memory allocator does not evict using brute …
URL: https://github.com/apache/hive/pull/626#discussion_r283523113
 
 

 ##########
 File path: 
llap-server/src/java/org/apache/hadoop/hive/llap/cache/BuddyAllocator.java
 ##########
 @@ -352,18 +440,21 @@ public void allocateMultiple(MemoryBuffer[] dest, int 
size, BufferObjectFactory
               LlapIoImpl.LOG.info("Failed to deallocate after a partially 
successful allocate: " + dest[i]);
             }
           }
+          //Need to release the un-allocated but reserved memory.
+          memoryManager.releaseMemory(dest.length - destAllocIx << allocLog2);
           String msg = "Failed to allocate " + size + "; at " + destAllocIx + 
" out of "
               + dest.length + " (entire cache is fragmented and locked, or an 
internal issue)";
           logOomErrorMessage(msg);
           throw new AllocatorOutOfMemoryException(msg);
         }
-        ++attempt;
+        ++discardsAttempt;
       }
     } finally {
+      //@TODO CHECK i think it is a bug, we do not have to release this memory 
if we already did deallocate(dest[i])
 
 Review comment:
   The deallocate path doesn't increment memoryForceReleased, so this here 
should be fine.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to