Skip to content

x/website/_content/doc: add note about how much memory the Go runtime retains to the GC guide #65013

Open
@stefanfrings2

Description

@stefanfrings2

Hello,
I spent a lot of time to find the reason of a "memory leak" which did not exist. There was a fundamental misunderstanding about memory management. We thought that the garbage collector returns unused heap memory back to the operating system, which was wrong.

The explanation is in #41444 (comment) :
"Since the Go garbage collector is designed to retain about twice as much memory as your live heap size, debug.FreeOSMemory is expected to free about half of your memory"

Would you please add this information to https://tip.golang.org/doc/gc-guide ?

I think is is very important to know.

Metadata

Metadata

Assignees

Labels

DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.website

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions