Skip to content

Commit

Permalink
br: reduce memory usage when get incomplete ranges (#57192)
Browse files Browse the repository at this point in the history
close #53529
  • Loading branch information
Leavrth authored Nov 13, 2024
1 parent 18fd780 commit 5129bb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion br/pkg/rtree/rtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ func (rangeTree *ProgressRangeTree) Iter() *IncompleteRangesFetcher {
}

func (iter *IncompleteRangesFetcher) GetIncompleteRanges() []Range {
incompleteRanges := make([]Range, 0, 64*len(iter.items))
// about 64 MB memory if there are 1 million ranges
incompleteRanges := make([]Range, 0, len(iter.items))
for _, item := range iter.items {
if item.complete {
continue
Expand Down

0 comments on commit 5129bb3

Please # to comment.