logoalt Hacker News

paulddraper • today at 8:13 PM • 1 reply • view on HN

GC is fast.

GC is not memory efficient.

If a primary concern is optimizing memory usage, you will avoid GC languages.


Replies

pron • today at 8:49 PM

That is not so simple. First, the differences among different GCs are larger than between some GCs and no GC. Second, moving GCs - of the kind used in HotSpot (as well as V8 and .NET), but not Go or Python (which are as different from each other as they are from moving GCs) - do, indeed have a higher memory utilisation, but it's not necessarily inefficient, because it comes into effect when CPU is under higher pressure than RAM. RAM and CPU are not independent resources; the most basic way to think about this is that your machine is exhausted when the first of CPU and RAM is exhausted. For example, I can take your car battery or I can take your petrol, but if I take your car battery when you don't have petrol, I'm not impacting your use of the car, so I'm not really creating any "inefficiency".

More here: https://youtu.be/xr73mR7ii9M