Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: use container memory if containerised for oom notifications#17062

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DanielleMaywood merged 6 commits intomainfromdm-use-container-memory
Mar 24, 2025

Conversation

DanielleMaywood
Copy link
Contributor

@DanielleMaywoodDanielleMaywood commentedMar 23, 2025
edited
Loading

Currently we query only the underlying host's memory usage for our memory resource monitor. This PR changes that to check if the workspace is in a container, and if so it queries the container's memory usage, falling back to the host's memory usage if not.

A container may not have a memory limit set. If there is no memory limitset, we want to fallback to using the memory available on the underlyinghost.
} else {
mem, err = f.HostMemory(clistat.PrefixDefault)
if err != nil {
return 0, 0, xerrors.Errorf("failed to host fetch memory: %w", err)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return0,0,xerrors.Errorf("failed tohostfetch memory: %w",err)
return0,0,xerrors.Errorf("failed to fetch host memory: %w",err)

if mem.Total == nil {
hostMem, err := f.HostMemory(clistat.PrefixDefault)
if err != nil {
return 0, 0, xerrors.Errorf("failed to host fetch memory: %w", err)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return0,0,xerrors.Errorf("failed tohostfetch memory: %w",err)
return0,0,xerrors.Errorf("failed to fetch host memory: %w",err)

@DanielleMaywoodDanielleMaywood marked this pull request as ready for reviewMarch 24, 2025 10:36
@DanielleMaywoodDanielleMaywood merged commit765e705 intomainMar 24, 2025
32 checks passed
@DanielleMaywoodDanielleMaywood deleted the dm-use-container-memory branchMarch 24, 2025 11:14
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 24, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@spikecurtisspikecurtisAwaiting requested review from spikecurtisspikecurtis is a code owner

@defelmnqdefelmnqAwaiting requested review from defelmnq

Assignees

@DanielleMaywoodDanielleMaywood

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@DanielleMaywood@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp