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 Lhmily commented Nov 15, 2019

go 1.10.1

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

@ALTree

This comment has been minimized.

Copy link
Member

@ALTree 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

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 15, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.