Skip to content

Commit

Permalink
address the comment
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <[email protected]>
  • Loading branch information
Yisaer committed May 6, 2022
1 parent 3879a6f commit e45dc60
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions statistics/handle/lru_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,10 @@ func (s *statsInnerCache) onEvict(tblID int64) {
}

func (s *statsInnerCache) freshTableCost(tblID int64, element *lruMapElement) {
newTblMem := element.tbl.MemoryUsage()
element.tblMemUsage = element.tbl.MemoryUsage()
for idxID, idx := range element.tbl.Indices {
s.lru.put(tblID, idxID, idx, newTblMem.IndicesMemUsage[idxID], true, false)
s.lru.put(tblID, idxID, idx, element.tblMemUsage.IndicesMemUsage[idxID], true, false)
}
// tbl mem usage might be changed due to evict
element.tblMemUsage = element.tbl.MemoryUsage()
}

func (s *statsInnerCache) capacity() int64 {
Expand Down

0 comments on commit e45dc60

Please sign in to comment.