Github user kumarvishal09 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2841#discussion_r228694154
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/memory/UnsafeMemoryManager.java 
---
    @@ -125,13 +117,24 @@ private synchronized MemoryBlock 
allocateMemory(MemoryType memoryType, String ta
           }
           listOfMemoryBlock.add(memoryBlock);
           if (LOGGER.isDebugEnabled()) {
    -        LOGGER.debug(String.format("Creating working Memory block (%s) 
with size %d."
    +        LOGGER.debug(String.format("Creating Offheap working Memory block 
(%s) with size %d."
                     + " Total memory used %d Bytes, left %d Bytes.",
                 memoryBlock.toString(), memoryBlock.size(), memoryUsed, 
totalMemory - memoryUsed));
           }
    -      return memoryBlock;
    +    } else {
    +      memoryBlock = MemoryAllocator.HEAP.allocate(memoryRequested);
    +      Set<MemoryBlock> listOfMemoryBlock = 
taskIdToMemoryBlockMap.get(taskId);
    +      if (null == listOfMemoryBlock) {
    +        listOfMemoryBlock = new HashSet<>();
    +        taskIdToMemoryBlockMap.put(taskId, listOfMemoryBlock);
    --- End diff --
    
    updated the variable name


---

Reply via email to