From faa1554aa1aa960582da5dbb2f1ace30468ae914 Mon Sep 17 00:00:00 2001 From: Ganesh Vernekar <15064823+codesome@users.noreply.github.com> Date: Tue, 22 Dec 2020 20:14:17 +0530 Subject: [PATCH] Don't call runtime.GC() after compaction (#8276) Signed-off-by: Ganesh Vernekar --- tsdb/db.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tsdb/db.go b/tsdb/db.go index dc94806df..efd579f3a 100644 --- a/tsdb/db.go +++ b/tsdb/db.go @@ -22,7 +22,6 @@ import ( "math" "os" "path/filepath" - "runtime" "sort" "strconv" "strings" @@ -875,7 +874,6 @@ func (db *DB) compactHead(head *RangeHead) error { return errors.Wrap(err, "persist head block") } - runtime.GC() if err := db.reloadBlocks(); err != nil { if errRemoveAll := os.RemoveAll(filepath.Join(db.dir, uid.String())); errRemoveAll != nil { return tsdb_errors.NewMulti( @@ -888,7 +886,6 @@ func (db *DB) compactHead(head *RangeHead) error { if err = db.head.truncateMemory(head.BlockMaxTime()); err != nil { return errors.Wrap(err, "head memory truncate") } - runtime.GC() return nil } @@ -915,7 +912,6 @@ func (db *DB) compactBlocks() (err error) { if err != nil { return errors.Wrapf(err, "compact %s", plan) } - runtime.GC() if err := db.reloadBlocks(); err != nil { if err := os.RemoveAll(filepath.Join(db.dir, uid.String())); err != nil { @@ -923,7 +919,6 @@ func (db *DB) compactBlocks() (err error) { } return errors.Wrap(err, "reloadBlocks blocks") } - runtime.GC() } return nil