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

Use cgroup to calculate available memory #89682

Closed
wants to merge 1 commit into from

Conversation

ntovas
Copy link

@ntovas ntovas commented Jul 29, 2023

Trying to fix #49317

It seems that on GCToOSInterface::GetMemoryStatus the GetPhysicalMemoryLimit works by checking first cgroup limits, but GetAvailablePhysicalMemory uses /proc/meminfo that in a containerized environment it will report the available memory of the worker and not of the pod.
This has as a result the check if (total > available) will be in a lot of cases false (when the worker available memory is more than the container's limit) and to report back to gc inconsistent data.

This is more a trigger for a discussion than a ready PR, since I have no experience in c++, neither in gc. We stumble upon this problem in the organization I am working, and this is an attempt to solve a gc related performance degradation.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jul 29, 2023
@ghost
Copy link

ghost commented Jul 29, 2023

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

Issue Details

Trying to fix #49317

It seems that on GCToOSInterface::GetMemoryStatus the GetPhysicalMemoryLimit works by checking first cgroup limits, but GetAvailablePhysicalMemory uses /proc/meminfo that in a containerized environment it will report the available memory of the worker and not of the pod.
This has as a result the check if (total > available) will be in a lot of cases false (when the worker available memory is more than the container's limit) and to report back to gc inconsistent data.

This is more a trigger for a discussion than a ready PR, since I have no experience in c++, neither in gc. We stumble upon this problem in the organization I am working, and this is an attempt to solve a gc related performance degradation.

Author: ntovas
Assignees: -
Labels:

area-GC-coreclr

Milestone: -

@mangod9
Copy link
Member

mangod9 commented Jul 31, 2023

@janvorli to review.

@ntovas ntovas closed this Aug 2, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-GC-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GC does not release memory easily on kubernetes cluster in workstation mode
3 participants