PingCAP plans to release v6.1.3 from release-6.1 branch with latest stable Golang version(current 1.19.3).
Upgrading from golang v1.18 to v1.19.3 will introduce this optimization:
The runtime now includes support for a soft memory limit. This memory limit includes the Go heap and all other memory managed by the runtime, and excludes external memory sources such as mappings of the binary itself, memory managed in other languages, and memory held by the operating system on behalf of the Go program. This limit may be managed via runtime/debug.SetMemoryLimit or the equivalent GOMEMLIMIT environment variable.