Skip to content

Enabled MADV_DONTNEED in systemd and docker files #22786

@urso

Description

@urso

The go runtime defaults to MADV_FREE by default. In that case pages are still assigned with the Beat, even after the pages have been "returned" to the OS. The kernel will eventually claim these pages, but RSS memory usage is reported as very high (which it is not necessarily). This seems to mess with the OOM killer at times.

As workaround one can tell the runtime to use MADV_DONTNEED via GODEBUG="madvdontneed=1". We should introduce this environment variable to the systemd file, init file, and docker file by default.

What to do

  • Add GODEBUG="madvdontneed=1" to docker images.
  • Add GODEBUG="madvdontneed=1" to systemd unit file.
  • Add GODEBUG="madvdontneed=1" to init file.
  • Add a note about this in known issues for 7.x maintained versions.
  • Backport the changes to 7.10 too.

More information

Metadata

Metadata

Labels

Team:Services(Deprecated) Label for the former Integrations-Services team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions