From 4b69c1162e442ae62c961344a037830c30ac24e1 Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Sat, 20 Apr 2019 22:47:03 -0400 Subject: [PATCH] Fix a memory issue that check -tabular uses too much memory with many revisions The call to GetSnapshotChunks in ShowStatisticsTabular sets keepChunkHashes to true -- this can cause too much memory consumption with hundreds of revisions. --- src/duplicacy_snapshotmanager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/duplicacy_snapshotmanager.go b/src/duplicacy_snapshotmanager.go index 3ee6a6a..2bfefd2 100644 --- a/src/duplicacy_snapshotmanager.go +++ b/src/duplicacy_snapshotmanager.go @@ -998,7 +998,7 @@ func (manager *SnapshotManager) ShowStatisticsTabular(snapshotMap map[string][]* earliestSeenChunks := make(map[string]int) for _, snapshot := range snapshotList { - for _, chunkID := range manager.GetSnapshotChunks(snapshot, true) { + for _, chunkID := range manager.GetSnapshotChunks(snapshot, false) { if earliestSeenChunks[chunkID] == 0 { earliestSeenChunks[chunkID] = math.MaxInt32 } @@ -1009,7 +1009,7 @@ func (manager *SnapshotManager) ShowStatisticsTabular(snapshotMap map[string][]* for _, snapshot := range snapshotList { chunks := make(map[string]bool) - for _, chunkID := range manager.GetSnapshotChunks(snapshot, true) { + for _, chunkID := range manager.GetSnapshotChunks(snapshot, false) { chunks[chunkID] = true snapshotChunks[chunkID] = true }