Hi,
Is there a way to set a hard limit on the max heap size a process is allowed to consume, from within it?
It's almost never a problem for a process to consume as much memory as is available, however, I've ran into real-life cases in a k8s environment, where a pod with a Go process will get evicted, when the pod approaches the memory limit of the node it's on.
Reducing GOGC improves the situation, however it doesn't act as a limit. And depending on the amount of data that's going through the process, it will still get evicted when it saturates the memory. I could also slow the whole process down, giving the GC even more time to reclaim the memory, but that sounds like a big workaround.