3 ms·
”As for energy savings, many garbage collectors have amortized energy use lower than malloc/free” For those wondering: that’s because malloc/free ‘visits’ ever
by Someone 8y ago
”As for energy savings, many garbage collectors have amortized energy use lower than malloc/free”
For those wondering: that’s because malloc/free ‘visits’ every dead object, while garbage collection visits the live ones (another way to say that: free collects garbage, the moment it is created, GC collects non-garbage, periodically) and there typically is way more garbage than non-garbage.
I haven’t seen energy usage comparisons that include extra energy use due to GC’s higher memory usage, though. That possibly is because it is hard to quantify. On current technology, you pay for your RAM’s energy usage the moment you power it on, whether you need it or not)