Skip to content

Commit

Permalink
Merge pull request #625 from gilbertchen/memory_optimization
Browse files Browse the repository at this point in the history
Rewrite the backup procedure to reduce memory usage
  • Loading branch information
gilbertchen authored Apr 8, 2022
2 parents a953c4e + fede9c7 commit f2d6de3
Show file tree
Hide file tree
Showing 20 changed files with 2,688 additions and 1,690 deletions.
18 changes: 17 additions & 1 deletion duplicacy/duplicacy_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,10 @@ func backupRepository(context *cli.Context) {

backupManager.SetupSnapshotCache(preference.Name)
backupManager.SetDryRun(dryRun)
backupManager.Backup(repository, quickMode, threads, context.String("t"), showStatistics, enableVSS, vssTimeout, enumOnly)

metadataChunkSize := context.Int("metadata-chunk-size")
maximumInMemoryEntries := context.Int("max-in-memory-entries")
backupManager.Backup(repository, quickMode, threads, context.String("t"), showStatistics, enableVSS, vssTimeout, enumOnly, metadataChunkSize, maximumInMemoryEntries)

runScript(context, preference.Name, "post")
}
Expand Down Expand Up @@ -1510,6 +1513,19 @@ func main() {
Name: "enum-only",
Usage: "enumerate the repository recursively and then exit",
},
cli.IntFlag{
Name: "metadata-chunk-size",
Value: 1024 * 1024,
Usage: "the average size of metadata chunks (defaults to 1M)",
Argument: "<size>",
},
cli.IntFlag{
Name: "max-in-memory-entries",
Value: 1024 * 1024,
Usage: "the maximum number of entries kept in memory (defaults to 1M)",
Argument: "<number>",
},

},
Usage: "Save a snapshot of the repository to the storage",
ArgsUsage: " ",
Expand Down
Loading

0 comments on commit f2d6de3

Please sign in to comment.