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

    https://github.com/apache/carbondata/pull/2841#discussion_r227246446
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/memory/UnsafeMemoryManager.java 
---
    @@ -124,8 +116,21 @@ private synchronized MemoryBlock 
allocateMemory(MemoryType memoryType, String ta
                 + "Bytes");
           }
           return allocate;
    +    } else {
    +      MemoryBlock allocate = 
MemoryAllocator.HEAP.allocate(memoryRequested);
    +      Set<MemoryBlock> listOfMemoryBlock = 
taskIdToMemoryBlockMap.get(taskId);
    +      if (null == listOfMemoryBlock) {
    +        listOfMemoryBlock = new HashSet<>();
    +        taskIdToMemoryBlockMap.put(taskId, listOfMemoryBlock);
    +      }
    +      listOfMemoryBlock.add(allocate);
    +      if (LOGGER.isDebugEnabled()) {
    +        LOGGER.debug("Memory block (" + allocate + ") is created with size 
" + allocate.size()
    +            + ". Total memory used " + memoryUsed + "Bytes, left " + 
(totalMemory - memoryUsed)
    +            + "Bytes");
    --- End diff --
    
    for On-Heap case totalMemory can be 0 also if not configured...so bytes 
left cannot be printed in the debug logs. For printing memory used add the 
allocated size to memory used for on-heap case


---

Reply via email to