Skip to content

Commit

Permalink
reduce memory usage when get incomplete ranges
Browse files Browse the repository at this point in the history
Signed-off-by: Jianjun Liao <[email protected]>
  • Loading branch information
Leavrth committed Nov 7, 2024
1 parent b522e98 commit 82ad6cd
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 82ad6cd

Please sign in to comment.