From 2fcb3947df77427cafdb613acd831d9cbc111530 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 2 Jun 2023 21:57:40 +0200 Subject: [PATCH] prune: trigger GC after prune planning --- cmd/restic/cmd_prune.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/restic/cmd_prune.go b/cmd/restic/cmd_prune.go index 26f21b1f3..1889dffd6 100644 --- a/cmd/restic/cmd_prune.go +++ b/cmd/restic/cmd_prune.go @@ -3,6 +3,7 @@ package main import ( "context" "math" + "runtime" "sort" "strconv" "strings" @@ -205,6 +206,9 @@ func runPruneWithRepo(ctx context.Context, opts PruneOptions, gopts GlobalOption return err } + // Trigger GC to reset garbage collection threshold + runtime.GC() + return doPrune(ctx, opts, gopts, repo, plan) }