Don't call runtime.GC() after compaction
@@ -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
