reduce memory pressure from marksets when the size is decreased

This commit is contained in:
vyzo 2021-07-05 11:51:22 +03:00
parent 3ec834b2e3
commit d7709deb2b

View File

@ -773,10 +773,7 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
log.Infow("warmup stats", "visited", count, "warm", xcount, "missing", missing) log.Infow("warmup stats", "visited", count, "warm", xcount, "missing", missing)
if count > s.markSetSize { s.markSetSize = count + count>>2 // overestimate a bit
s.markSetSize = count + count>>2 // overestimate a bit
}
err = s.ds.Put(markSetSizeKey, int64ToBytes(s.markSetSize)) err = s.ds.Put(markSetSizeKey, int64ToBytes(s.markSetSize))
if err != nil { if err != nil {
log.Warnf("error saving mark set size: %s", err) log.Warnf("error saving mark set size: %s", err)
@ -844,9 +841,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
return xerrors.Errorf("error marking: %w", err) return xerrors.Errorf("error marking: %w", err)
} }
if count > s.markSetSize { s.markSetSize = count + count>>2 // overestimate a bit
s.markSetSize = count + count>>2 // overestimate a bit
}
log.Infow("marking done", "took", time.Since(startMark), "marked", count) log.Infow("marking done", "took", time.Since(startMark), "marked", count)