diff --git a/Heaplog.png b/Heaplog.png new file mode 100644 index 0000000..4b9995e Binary files /dev/null and b/Heaplog.png differ diff --git a/ui/app.go b/ui/app.go index 0a2cc94..d8bb34e 100644 --- a/ui/app.go +++ b/ui/app.go @@ -19,6 +19,7 @@ import ( "log" "os" "path/filepath" + "runtime/debug" "time" ) @@ -294,9 +295,14 @@ func NewHeaplog(cfg Config, startBackground bool) (*HeaplogApp, error) { select { case <-t.C: go func() { - _, err := ii.Merge(20, 30, int(cfg.Concurrency)) - if err != nil { - log.Printf("merging inverted index segments: %s", err) + for { + merged, err := ii.Merge(20, 30, int(cfg.Concurrency)) + if err != nil { + log.Printf("merging inverted index segments: %s", err) + } + if merged == 0 { + break + } } }() @@ -326,6 +332,8 @@ func NewHeaplog(cfg Config, startBackground bool) (*HeaplogApp, error) { return } } + + debug.FreeOSMemory() } }() }