Re:For Better Computing, Liberate CPUs from Garbage Collection
by arcticbull on Thursday May 09, 2019 @01:40PM
(#19870361)
I like the waterbed theory, thanks, I hadn't heard of it before.
You're absolutely right, in the GC context you:
(1) Have to manually reference count / manage external resources like sockets and files because you can't count on the destructor to ever run.
(2) Lose determinism and then have to spend huge amounts of effort tweaking GC parameters to fix your issue, but to your point, it becomes a Jenga tower where you touch one part and the whole thing falls down again.
(3) Can easily still leak huge portions of your object graph by, for instance, throwing them into long-lived dictionaries.
Re:For Better Computing, Liberate CPUs from Garbage Collection
by kazinator on Thursday May 09, 2019 @01:52PM
(#19870470)
In what memory management paradigm can you free the object in a long-lived dictionary without removing it from that dictionary, and do you advocate this paradigm?
You're absolutely right, in the GC context you:
(1) Have to manually reference count / manage external resources like sockets and files because you can't count on the destructor to ever run.
(2) Lose determinism and then have to spend huge amounts of effort tweaking GC parameters to fix your issue, but to your point, it becomes a Jenga tower where you touch one part and the whole thing falls down again.
(3) Can easily still leak huge portions of your object graph by, for instance, throwing them into long-lived dictionaries.