Re:For Better Computing, Liberate CPUs from Garbage Collection
by gpderetta on Thursday May 09, 2019 @05:18AM
(#19866611)
Memory you are wasting for GC is Memory you are not using, for example, for caching which directly impacts performance.
Mind you, I think GC is great, but saying that RAM is free is misguided.
Re:For Better Computing, Liberate CPUs from Garbage Collection
by bunderbunder on Thursday May 09, 2019 @09:51AM
(#19868258)
FWIW, one mitigating factor is that GC isn't the only approach that wastes memory. You can also end up with memory waste in manual memory management. Due to heap fragmentation, for example, or retaining objects for longer than necessary due to programmer caution or error. I don't (personally) dare estimate their relative sizes, because I'm guessing a huge, perhaps dominant, share of differences in memory usage across languages is driven by features other than GC. Dynamic typing, for example.
Re:For Better Computing, Liberate CPUs from Garbage Collection
by pron on Thursday May 09, 2019 @05:47AM
(#19866727)
I didn't say it's free, only that it's relatively cheap. That RAM can simply be used for caching is incorrect, though. There are very-non-neglible costs to maintaining caches in distributed systems.
Re:For Better Computing, Liberate CPUs from Garbage Collection
by benchaney on Thursday May 09, 2019 @10:57AM
(#19868863)
It’s not clear what you mean by a distributed system in this context, but RAM is used for caching, costs or no.
Re:For Better Computing, Liberate CPUs from Garbage Collection
by pron on Thursday May 09, 2019 @01:17PM
(#19870143)
My point is that you can't increase the cache size indefinitely to get performance improvements, because you also have to handle cache invalidation. There is an optimal working set.
Re:For Better Computing, Liberate CPUs from Garbage Collection
by imtringued on Thursday May 09, 2019 @05:25AM
(#19866647)
Using RAM for "caching" sounds extremely wasteful. There could be applications that want to use it for something more useful than a 1% performance improvement.
Re:For Better Computing, Liberate CPUs from Garbage Collection
by benchaney on Thursday May 09, 2019 @10:55AM
(#19868838)
Caching is way more impactful than a 1% speed up. It is hard to know exactly, because it is impossible to disable on most modern operating systems, but I wouldn’t be surprised if it were an order of magnitude improvement in some situations.
By the way, caching doesn’t prevent RAM for being used by applications. If an application wants more memory, the os can always just evict some of the cache.
Of course. RAM is the price we pay for GC. Good thing it's so cheap on servers.
BTW, just note that the paper doesn't compare GC (never mind that the algorithms have much improved since then) to real explicit memory management, but to an oracle (i.e. explicit memory management by an all-knowing God). Paying nothing other than for 3x RAM to get performance that's 17% worse than what God could achieve is a bargain, and why GC is considered one of the greatest success stories of modern computing.