If a diff we compute for --changed-path has more than 512 entries, we don't bother generating a bloom filter for it. But since we don't iterate over diff_queued_diff, we also don't free the filepairs and filespecs from the diff before clearing the queue. Let's make sure we do so. This drops the peak heap usage of "commit-graph write --changed-paths" on linux.git from ~8GB to ~4GB. Signed-off-by: Jeff King <peff@xxxxxxxx> --- bloom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bloom.c b/bloom.c index 0c7505d3d6..d1d3796e11 100644 --- a/bloom.c +++ b/bloom.c @@ -226,6 +226,8 @@ struct bloom_filter *get_bloom_filter(struct repository *r, hashmap_free_entries(&pathmap, struct pathmap_hash_entry, entry); } else { + for (i = 0; i < diff_queued_diff.nr; i++) + diff_free_filepair(diff_queued_diff.queue[i]); filter->data = NULL; filter->len = 0; } -- 2.24.1.1152.gda0b849012