upvote
Which is what OSes implemented in system languages with automatic memory management usually do, it is an OS service.

Oberon example,

https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne...

Active Oberon example,

https://github.com/btreut/a2/blob/master/source/GarbageColle...

Bare metal Java, Go, .NET, Erlang, OCaml,... with bare metal deployments naturally have the runtime take the OS role.

reply
This is far from trivial. Consider the WasmGC proposal, which had a somewhat similar goal.

Then C# came and said "we can't use it, we have different needs". So did Go.

reply
> Then C# came and said

It's worse than that. The WASM GC standards team was warned in advance that the proposal wouldn't work for .NET, and they moved forward with it anyway:

https://github.com/WebAssembly/gc/issues/77

They were also warned about Go (though I'm not sure if they ever actually consulted with golang devs):

https://github.com/WebAssembly/gc/issues/36

More links:

https://github.com/dotnet/runtime/issues/94420

https://github.com/golang/go/issues/63904

reply
The ram usage in this case is an order of magnitude lower if you install ublock in edge, as other comments have noted. Why would a system level GC affect wasteful adtech?

Any marginal efficiency gains will be wiped out with more adslop. Nathan's law.

reply
> A major part of why these sort of simple applications are taking gbs of memory is because the GC wants to simply grow as much as it can to avoid pauses/jank. There might be 10% of the memory which is actually live in that 1gb. But because it allocates fast enough, the extra headroom is needed.

There’s very minimal state for a weather app. You should be able to sweep the whole thing pretty fast. You could probably statically allocate most of that state.

reply
> There’s very minimal state for a weather app.

Except when it uses some kind of browser engine to render its UI?

reply