[ 
https://issues.apache.org/jira/browse/HIVE-21686?focusedWorklogId=241297&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-241297
 ]

ASF GitHub Bot logged work on HIVE-21686:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/May/19 20:46
            Start Date: 13/May/19 20:46
    Worklog Time Spent: 10m 
      Work Description: odraese commented on pull request #626: [HIVE-21686] 
ensure that memory allocator does not evict using brute …
URL: https://github.com/apache/hive/pull/626#discussion_r283427735
 
 

 ##########
 File path: 
llap-server/src/java/org/apache/hadoop/hive/llap/cache/BuddyAllocator.java
 ##########
 @@ -65,19 +83,26 @@
   private final long maxSize;
   private final boolean isDirect;
   private final boolean isMapped;
+  private final int maxForcedEvictionSize;
   private final Path cacheDir;
 
   // These are only used for tests.
   private boolean enableDefragShortcut = true, oomLogging = true;
 
   // We don't know the acceptable size for Java array, so we'll use 1Gb 
boundary.
   // That is guaranteed to fit any maximum allocation.
-  private static final int MAX_ARENA_SIZE = 1024*1024*1024;
+  private static final int MAX_ARENA_SIZE = 1024 * 1024 * 1024;
   // Don't try to operate with less than MIN_SIZE allocator space, it will 
just give you grief.
-  private static final int MIN_TOTAL_MEMORY_SIZE = 64*1024*1024;
+  private static final int MIN_TOTAL_MEMORY_SIZE = 64 * 1024 * 1024;
   // Maximum reasonable defragmentation headroom. Mostly kicks in on very 
small caches.
   private static final float MAX_DEFRAG_HEADROOM_FRACTION = 0.01f;
-
+  /**
+   * Max number of attempts to try allocations before giving up and move to 
forced evictions or/and freelist/brut
 
 Review comment:
   brut -> brute 
   Also, having some comment, explaining the forced eviction (brute force 
discards) or freeList would help.
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 241297)
    Time Spent: 2h 20m  (was: 2h 10m)

> Brute Force eviction can lead to a random uncontrolled eviction pattern.
> ------------------------------------------------------------------------
>
>                 Key: HIVE-21686
>                 URL: https://issues.apache.org/jira/browse/HIVE-21686
>             Project: Hive
>          Issue Type: Bug
>            Reporter: slim bouguerra
>            Assignee: slim bouguerra
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: Cache_hitrate_improvement.csv, HIVE-21686.2.patch, 
> HIVE-21686.patch
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Current logic used by brute force eviction can lead to a perpetual random 
> eviction pattern.
> For instance if the cache build a small pocket of free memory where the total 
> size is greater than incoming allocation request, the allocator will randomly 
> evict block that fits a particular size.
> This can happen over and over therefore all the eviction will be random.
> In Addition this random eviction will lead a leak in the linked list 
> maintained by the policy since it does not know anymore about what is evicted 
> and what not.
> The improvement of this patch is very substantial  to TPC-DS benchmark. I 
> have tested it with 10TB scale 9 llap nodes and 32GB cache size per node.  
> The patch has showed very noticeable difference in the Hit rate for raw 
> number  [^Cache_hitrate_improvement.csv] 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to