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

runtime: memalloc does not respect cgroups limits (?) #22419

Closed
utrack opened this issue Oct 24, 2017 · 3 comments

Comments

Projects
None yet
4 participants
@utrack
Copy link

commented Oct 24, 2017

What version of Go are you using (go version)?

1.9

Does this issue reproduce with the latest release?

Y

What operating system and processor architecture are you using?

amd64

I'm trying to run a service that allocates lots of memory per request in Kubernetes pod w/ limited memory on a machine with lots of memory available - and service grows RES mem under load until it is killed due OOM. Service does not leak memory - running same binary with same load on a real machine with physical RAM of the same size yields stable RES mem graph.

It seems that memory allocator (or GC?) do not respect cgroups memory limits when deciding if GC should be ran aggressively and/or if unused res mem pages should be released.

@ALTree

This comment has been minimized.

Copy link
Member

commented Oct 24, 2017

Dup of #5049? And this kind of issues are now tracked in #16843.

@utrack

This comment has been minimized.

Copy link
Author

commented Oct 24, 2017

@ALTree: yup, I saw those two. ulimit works independently of cgroups I believe, didn't check yet if cgroups are covered by #16843. Feel free to close the issue if it is.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2017

The current Go memory allocator does not respect any sort of memory limits at all. The current work on #16843 assumes that the user is going to explicitly tell the runtime package approximately how memory to allocate, with the understanding that the runtime may overshoot that number. Any attempt to set that limit automatically based on ulimit or whatever is going to be a later and longer discussion.

I don't think there is any purpose to be served by keeping this issue open at this time, so I am going to close it.

@golang golang locked and limited conversation to collaborators Oct 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.