Skip to content
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

Avoid declaring an object cannot fit in a segment if we already have committed space for it #55585

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

cshung
Copy link
Member

@cshung cshung commented Jul 13, 2021

The function sufficient_space_end_seg is used to check if we have sufficient space at the end of a segment to allocate a certain amount of space. The original implementation checks if we have sufficient reserved space, if not, we fail immediately, otherwise, we check for the hard limit, assuming all the space required has to be extra committed memory.

But in many cases, the ephemeral_heap_segment has committed memory at its end already, we should consider those spaces first before we check if the extra commit fits within the hard limits.

The change deliberately skips the region's case for now, which seems more complicated than I wanted for this change.

@ghost
Copy link

ghost commented Jul 13, 2021

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Issue Details

The function sufficient_space_end_seg is used to check if we have sufficient space at the end of a segment to allocate a certain amount of space. The original implementation checks if we have sufficient reserved space, if not, we fail immediately, otherwise, we check for the hard limit, assuming all the space required has to be extra committed memory.

But in many cases, the ephemeral_heap_segment has committed memory at its end already, we should consider those spaces first before we check if the extra commit fits within the hard limits.

The change deliberately skips the region's case for now, which seems more complicated than I wanted for this change.

Author: cshung
Assignees: -
Labels:

area-GC-coreclr

Milestone: -

@cshung cshung requested a review from PeterSolMS July 13, 2021 17:47
Copy link
Member

@Maoni0 Maoni0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cshung cshung merged commit f531684 into dotnet:main Jul 13, 2021
@cshung cshung deleted the public/avoid-oom branch July 13, 2021 22:10
@ghost ghost locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants