News for hackers. Stuff that matters.
Re:Replacing a $3000/mo Heroku bill with a $55/mo server by zozbot234 on Tuesday October 21, 2025 @07:10PM (#45662942)
Every garbage collector has to constantly sift through the entire reference graph of the running program to figure out what objects have become garbage. Generational GC's can trace through the oldest generations less often, but that's about it.

Tracing garbage collectors solve a single problem really really well - managing a complex, possibly cyclical reference graph, which is in fact inherent to some problems where GC is thus irreplaceable - and are just about terrible wrt. any other system-level or performance-related factor of evaluation.

Re:Replacing a $3000/mo Heroku bill with a $55/mo server by eru on Tuesday October 21, 2025 @08:05PM (#45663383)
Modern garbage collectors have come a long way.

Even not so modern ones: have you heard of generational garbage collection?

But even in eg Python they introduced 'immortal objects' which the GC knows not to bother with.

Re:Replacing a $3000/mo Heroku bill with a $55/mo server by winrid on Wednesday October 22, 2025 @02:29AM (#45665528)
It doesn't matter. The GC does not know what heap allocations are in memory vs swap, and since you don't write applications thinking about that, running a VM with a moving GC on swap is a bad idea.
Re:Replacing a $3000/mo Heroku bill with a $55/mo server by eru on Wednesday October 22, 2025 @04:37AM (#45666328)
A moving GC can make sure to separate hot and cold data, and then rely on the kernel to keep hot data in RAM.
Re:Replacing a $3000/mo Heroku bill with a $55/mo server by winrid on Wednesday October 22, 2025 @04:51PM (#45674983)
Yeah but in practice I'm not sure that really works well with any GCs today? Ive tried this with modern JVM and Node vms, it always ended up with random multi second lockups. Not worth the time.
Re:Replacing a $3000/mo Heroku bill with a $55/mo server by cogman10 on Tuesday October 21, 2025 @07:34PM (#45663131)
> Every garbage collector has to constantly sift through the entire reference graph of the running program to figure out what objects have become garbage.

There's a lot of "it depends" here.

For example, an RC garbage collector (Like swift and python?) doesn't ever trace through the graph.

The reason I brought up moving collectors is by their nature, they take up a lot more heap space, at least 2x what they need. The advantage of the non-moving collectors is they are much more prompt at returning memory to the OS. The JVM in particular has issues here because it has pretty chunky objects.

Re:Replacing a $3000/mo Heroku bill with a $55/mo server by Dylan16807 on Tuesday October 21, 2025 @11:15PM (#45664560)
> The reason I brought up moving collectors is by their nature, they take up a lot more heap space, at least 2x what they need.

If the implementer cares about memory use it won't. There are ways to compact objects that are a lot less memory-intensive than copying the whole graph from A to B and then deleting A.