-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: Go RSS memory does not decrease, memory not returned to OS #39779
Comments
Thank you for raising this issue. From the information you provided, it looks like all but 17mb of the go heap has been released back to the operating system. However, unless there is memory pressure the operating system may ignore the request to release memory because the signal we send to the operating system is advisory. It looks like this what is happening. ps. To improve accessibility, in the future please do not includes screenshots of text, just copy and paste the text. |
I also run this service in Ubuntu 16.04.6 LTS with source code, the RSS decrease from 700M to 130M when I stopped test script. |
Yes. The Go runtime has told the OS that it no longer needs the memory. But unless the OS needs those pages for something else, it does not take them back. So the Go process's RSS does not drop. |
@jinlianch This issue seems like it has received sufficient responses. I'm going to close the issue. Please feel free to respond in the issue if you feel like it was closed in error. |
What version of Go are you using (
go version
)?1.14.1
What operating system and processor architecture are you using (
go env
)?Running in docker
Linux 4.14.177-139.254.amzn2.x86_64
What did you do?
We have a grpc server handle client request, may have many memory allocation, will get data from redis and parse it and send back to client. when the concurrency is high, the memory increase, while requests stop, the resident memory don't decrease.
If keep request server, might cause OOM.
What did you expect to see?
RSS should decrease when requests decrease or stop.
What did you see instead?
RSS keeps ~740M for long time.
While memstats shows gc works well.
Profile heap:
Profile goroutine:
The text was updated successfully, but these errors were encountered: