|
|
|
|
|
by pron
15 days ago
|
|
That is not so simple. First, the differences among different GCs are bigger 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 most of it comes into effect when CPU is under higher pressure than RAM (that's when you get a larger young-gen, as the heap overhead is a function of the allocation rate, not of the live set which, in turn, means a high CPU usage). 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". You are right, though, that in a very memory-constrained environment, usually embedded devices, you may want to lower memory consumption regardless of anything else, and in such environments moving GCs are probably not what you want (although other kinds of GC could be). More here: https://youtu.be/xr73mR7ii9M |
|