-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improvement](segment) reduce memory usage when open segments (#46570) #47201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…#46570) Issue Number: close #xxx Related PR: #xxx Problem Summary: When there are a lot of segments in one rowset, it will consume plenty of memory if open all the segments all at once. This PR open segments one by one and release the `Segment` object immediately if it's not need to be kept for later use, thus reduce memory footprints dramatically.
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 41498 ms |
TPC-DS: Total hot run time: 198471 ms |
ClickBench: Total hot run time: 33.17 s |
| std::static_pointer_cast<BetaRowset>(shared_from_this()), i, | ||
| &segment_cache_handle, false, false)); | ||
| const auto& tmp_segments = segment_cache_handle.get_segments(); | ||
| _segments_rows[i] = tmp_segments[0]->num_rows(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any chance that tmp_segments is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it reaches line 83, it means SegmentLoader::instance()->load_segment returns OK and it assures segment_cache_handle.get_segments() is not empty.
|
We're closing this PR because it hasn't been updated in a while. |
Issue Number: close #xxx
BP #46570
Problem Summary:
When there are a lot of segments in one rowset, it will consume plenty of memory if open all the segments all at once. This PR open segments one by one and release the
Segmentobject immediately if it's not need to be kept for later use, thus reduce memory footprints dramatically.What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)