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

Frequent GC caused by insufficient memory #35613

Closed
lhmily opened this issue Nov 15, 2019 · 2 comments
Closed

Frequent GC caused by insufficient memory #35613

lhmily opened this issue Nov 15, 2019 · 2 comments

Comments

@lhmily
Copy link

lhmily commented Nov 15, 2019

go 1.10.1

Frequent GC caused by insufficient memory in the host results in high cpu load

@ALTree
Copy link
Member

ALTree commented Nov 15, 2019

Hi,

I'm not sure this report is actionable. If you are running on a low-memory machine and you allocate a lot, it's unavoidable that the GC will consume a fair amount of CPU, since it has a lot of work to do.

The only way to fix this is to change your program to allocate less. This will lower the CPU load (at least the part of it the GC is responsible of).

Another solution would be to decrease GOGC (e.g. you could set GOGC=50), that would lower the GC's cpu usage, but it'll increase the used memory, so you likely cannot afford to do this on a low-memory machine.

@ianlancetaylor
Copy link
Contributor

Also the garbage collector has improved since 1.10. The current release is 1.13.

The garbage collector team is always happy to get test cases they can use to test the garbage collector. But without a lot more information, there is nothing we can do here.

@golang golang locked and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants