Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
fix lower heap hard limit condition for regions#76407
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
Merged
+38
−3
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
27c868d
fix lower heap hard limit condition for regions
mangod9 02786e5
adjust region sizes based on individual heap sizes
mangod9 2b43f8a
updated comment
mangod9 ae8e0d6
more tuning
mangod9 b20ea3f
on more tuning update.
mangod9 e68e93e
fixing the case for per heap hard_limit and some styling changes.
mangod9 18e0c32
CR updates
mangod9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -44894,10 +44894,20 @@ HRESULT GCHeap::Initialize() | ||
| { | ||
| if (gc_heap::heap_hard_limit) | ||
| { | ||
| gc_heap::regions_range = 2 * gc_heap::heap_hard_limit; | ||
| if (gc_heap::heap_hard_limit_oh[soh]) | ||
| { | ||
| gc_heap::regions_range = gc_heap::heap_hard_limit; | ||
| } | ||
| else | ||
| { | ||
| // We use this calculation because it's close to what we used for segments. | ||
| gc_heap::regions_range = ((gc_heap::use_large_pages_p) ? (2 * gc_heap::heap_hard_limit) | ||
| : (5 * gc_heap::heap_hard_limit)); | ||
mangod9 marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| } | ||
| else | ||
| { | ||
| // If no hard_limit is configured the reservation size is max of 256gb or 2x physical limit | ||
| gc_heap::regions_range = max(((size_t)256 * 1024 * 1024 * 1024), (size_t)(2 * gc_heap::total_physical_mem)); | ||
| } | ||
| gc_heap::regions_range = align_on_page(gc_heap::regions_range); | ||
| @@ -45044,7 +45054,30 @@ HRESULT GCHeap::Initialize() | ||
| #ifdef USE_REGIONS | ||
| gc_heap::enable_special_regions_p = (bool)GCConfig::GetGCEnableSpecialRegions(); | ||
| size_t gc_region_size = (size_t)GCConfig::GetGCRegionSize(); | ||
| if (!power_of_two_p(gc_region_size) || ((gc_region_size * nhp * 19) > gc_heap::regions_range)) | ||
| // Adjust GCRegionSize based on how large each heap would be, for smaller heaps we would | ||
| // like to keep Region sizes small. We choose between 4, 2 and 1mb based on the calculations | ||
| // below (unless its configured explictly) such that there are at least 2 regions available | ||
| // except for the smallest case. Now the lowest limit possible is 4mb. | ||
| if (gc_region_size == 0) | ||
| { | ||
| // We have a minimum amount of basic regions we have to fit per heap, and we'd like to have the initial | ||
| // regions only take up half of the space. | ||
| if ((gc_heap::regions_range / nhp / min_regions_per_heap) / 2 >= (4 * 1024 * 1024)) | ||
| { | ||
| gc_region_size = 4 * 1024 * 1024; | ||
| } | ||
| else if ((gc_heap::regions_range / nhp / min_regions_per_heap) / 2 >= (2 * 1024 * 1024)) | ||
| { | ||
| gc_region_size = 2 * 1024 * 1024; | ||
| } | ||
| else | ||
| { | ||
| gc_region_size = 1 * 1024 * 1024; | ||
| } | ||
| } | ||
| if (!power_of_two_p(gc_region_size) || ((gc_region_size * nhp * min_regions_per_heap) > gc_heap::regions_range)) | ||
| { | ||
| return E_OUTOFMEMORY; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.