diff --git a/maker/golang/cmd/bench.go b/maker/golang/cmd/bench.go index a008a72..851bfd5 100644 --- a/maker/golang/cmd/bench.go +++ b/maker/golang/cmd/bench.go @@ -93,6 +93,8 @@ func Bench(sCmd string) { defer handle.Close() var rgCache = xdb.NewRegionCache() + defer rgCache.Clean() + var count, errCount, tStart = 0, 0, time.Now() slog.Info("Bench start", "xdbPath", dbFile, "srcPath", srcFile) _, _, iErr := xdb.IterateSegments(handle, false, func(l string) { diff --git a/maker/golang/xdb/editor.go b/maker/golang/xdb/editor.go index e1bc7d7..959a807 100644 --- a/maker/golang/xdb/editor.go +++ b/maker/golang/xdb/editor.go @@ -416,4 +416,5 @@ func (e *Editor) SaveToFile(dstFile string) error { func (e *Editor) Close() { _ = e.srcHandle.Close() + e.rgCache.Clean() } diff --git a/maker/golang/xdb/maker.go b/maker/golang/xdb/maker.go index a9aea1c..5772aa2 100644 --- a/maker/golang/xdb/maker.go +++ b/maker/golang/xdb/maker.go @@ -414,5 +414,7 @@ func (m *Maker) End() error { return err } + m.regionCache.Clean() + return nil } diff --git a/maker/golang/xdb/processor.go b/maker/golang/xdb/processor.go index af2f20e..386b04b 100644 --- a/maker/golang/xdb/processor.go +++ b/maker/golang/xdb/processor.go @@ -156,5 +156,7 @@ func (p *Processor) End() error { return err } + p.rgCache.Clean() + return nil }