News for hackers. Stuff that matters.
Re:A Practical Guide to Memory Leaks in Node.js by sweeneyrod on Sunday March 29, 2020 @06:41AM (#22717850)
Collecting exactly the dead objects in all situations is not possible even in theory:

    function f() {
        x = Object(1)
        if (halts(some_program)) {
            return Object(2)
        } else {
            return x;
        }
    }
The contents of x will be dead or not after the assignment depending on whether some_program halts. But a GC that could determine that could solve the halting problem.
Re:A Practical Guide to Memory Leaks in Node.js by zamadatix on Sunday March 29, 2020 @10:43PM (#22724749)
That code doesn't make any sense. Either halts() itself is a function that solves the halting problem or the else branch is a dead branch because in order to be selected halts() must have never returned.

Dynamic code is where the GC can't know if something simply has a stale reference or if the codepath that calls it simply doesn't exist yet. It's be interesting to need to tag such data appropriately as that opens up a lot of leak protection.

Re:A Practical Guide to Memory Leaks in Node.js by sweeneyrod on Tuesday March 31, 2020 @08:26AM (#22736819)
Yep, you're right. I should've just said that the condition of the if statement can in general be undecidable.