News for hackers. Stuff that matters.
Re:One Year After Switching from Java to Go: Our Experiences by lenkite on Wednesday February 19, 2025 @08:16AM (#43101804)
AFAIK, the basic issue is still open at https://github.com/golang/go/issues/33803 and https://github.com/golang/go/issues/59715.

You still need to use a helper library like https://github.com/KimMachineGun/automemlimit or https://github.com/uber-go/automaxprocs.

Go 1.19 only had this in its notes for memory changes

"...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"

Forgot to add: The JVM does this for you since JDK 17 https://developers.redhat.com/articles/2022/04/19/java-17-wh...

Re:One Year After Switching from Java to Go: Our Experiences by demi56 on Wednesday February 19, 2025 @08:57AM (#43102206)
> ...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"

Of course it’s a runtime setting, it won’t affect other factors but you can’t say it didn’t solved anything “because there’s a GitHub issue open” Then Go runtime was unpredictable because of its ideology “CPU is unlimited but not Memory” and containers are kinda of a dynamic resource allocated but it did solve vast amount of problem dealing with kernel OOM and unpredictable GC cycles

> You still need to use a helper library like https://github.com/KimMachineGun/automemlimit or https://github.com/uber-go/automaxprocs.

I would be surprised if the Go team implemented it into the runtime, because some devs would love to have there own way of handling such settings so I don’t see it as an issue

> Forgot to add: The JVM does this for you since JDK 17 https://developers.redhat.com/articles/2022/04/19/java-17-wh...

We can’t just compare added features if don’t compare how backwards compatible the language is at that time I don’t know much about Java, but I wouldn’t say the same from upgrading from Go 1.9 to Go 1.19

Re:One Year After Switching from Java to Go: Our Experiences by lenkite on Wednesday February 19, 2025 @10:03AM (#43102832)
Sorry, but no - putting the burden on the developer to detect whether they are running in a container or not and then determine and adjust to cgroup settings is far too high an encumbrance on the service developer. This is a demonstrative example of a fundamental responsibility that should always be delegated to the runtime as the default behavior.

Neither Go 1.19 nor any subsequent version has "solved" this issue.

Re:One Year After Switching from Java to Go: Our Experiences by demi56 on Wednesday February 19, 2025 @11:31AM (#43104014)
> Sorry, but no - putting the burden on the developer to detect whether they are running in a container or not and then determine and adjust to cgroup settings is far too high an encumbrance on the service developer.

Because there’s no one way solution to this problem, the problem isn’t unique to only Go, but every GC language because you’re starving the program if there isn’t sufficient CPU Quota it will all eventually lead to CPU throttling, this isn’t really the problem of Go or any other GC language but at the OS layer, the inherent nature of containers

Secondly am pretty sure the Linux CFS does not strictly follow the CPU Quota, tho there could be something like a panic or warning, or switching to entirely different memory management just for what ? people who want 10ms ?

Re:One Year After Switching from Java to Go: Our Experiences by btreecat on Wednesday February 19, 2025 @08:37AM (#43101997)
Most Jvm shops/devs I know are still on 11
Re:One Year After Switching from Java to Go: Our Experiences by lenkite on Wednesday February 19, 2025 @08:41AM (#43102033)
That's the problem isn't it ? The Java of 8+ years ago is always compared to the Rust/Go/Python of today. (I am also guilty of this)
Re:One Year After Switching from Java to Go: Our Experiences by gf000 on Wednesday February 19, 2025 @08:57AM (#43102207)
Upgrading from 11 is trivial though and we are at almost 24. The hardest was 8->9, or 9->11.
Re:One Year After Switching from Java to Go: Our Experiences by pjmlp on Wednesday February 19, 2025 @03:44PM (#43107417)
And many folks still code in C89, C99, C++98, Python 2, .NET Framework....

Language is not to blame for unwillingness to move forward.