What if Garbage Collection was like Garbage Collection?

Every Thursday morning at 6:00am, the garbage truck stops in front of your house.  A scruffy man in an orange jumpsuit steps down, walks up to your front door, and lets himself in. 

He walks around the house, picking up each item you own, and asks, "Are you still using this?"  If you don't say "yes", he carts it away.

Comments (11)

  1. Matthew W. Jackson says:

    "The garbage man can! Yes the garbage man can!"

    What about the other way around (computer garbage collection more like real life garbage collection)? What if you had if you had to add all items you were done with to a "garbage can," and periodically move the garbage outside to be deleted or recycled by the garbage collector. You’d have the problems of deterministic finalization and garbage collection combined! How fun!

  2. What if your garbage collection routines actually had the sophistication of an advanced AI and only externally did simple garbage collection as we know it, but was internally working on the final details of the Unified Theory.

    Dilbert reference, anyone? 🙂

  3. RossChang says:

    What if your garbage collector comes in to do the job every 1-5 minutes interval, and keep asking you "are you using this? are you using that?" and you just have to keep saying "Yes, yes yes yes…"

  4. The downside would be that your desk would have to get full of junk before that was got cleaned, and I don’t want to imagine what the place would look like by the time a gen2 collection rolled around…

  5. Nat says:

    I think it should be more like this….

    He walks around the house, picks up each item you own, and notices that you haven’t used those items since:

    1. He can determine that you brain has no memory about those items at all (even in your brain tumor) or

    2. You destroyed it by tearing it out like you tear archaic credit card statements or

    3. You haven’t used it in age and you mark that you don’t use it any more

    He can come as many as you like (GC.Collect) but he has a garbage alarm signal to alert whether your house is full of sh*t so he can come on his own as well. Every time he comes to your house, you will be a little bit interrupted since he walks around so that you can’t concentrate very well 🙂

    Another good thing is that the garbage man will ask you if you want to give a farewell or final words to each object before he takes it away if you say so (.Finalize())

    Only bad thing is that he never asked you specifically which piece to collect or not. And you cannot force him to pick up any specific items each time he comes; you can only tell him to come to your house to clean up…. He might not pick up anything if you still have some memory or thinking about that item.

  6. Philip Rieck says:

    In the words of my favorite sanitation commisioner "Can’t somone else do it?"

    I’m assuming this was just a fun rambling? I’m always wary of "real-life" analogies – They can be good explanitory help, but almost always lead you down the wrong path if you start basing decisions or arguments on them…

  7. This actually isn’t all that far fetched. There is a really neat type of analysis that can be done on programs called "shape analaysis" that can detect places in a program where deterministic finalization can be inserted. Its not perfect, and it won’t every thing, but it can find a lot.

    It is an expensive analysis, so it isn’t something that you would want to build into a JIT compiler, but it could be placed into the front end .NET compilers (C#, VB, C++) and inject meta data about its results into the IL that the JIT compiler uses.

  8. AndrewSeven says:

    What about the yicky stuff that drips out or the little itty bits of paper that fall by the way-side…

  9. dal says:

    If anyone, let alone the garbage man, let himself unannounced into my home at 6AM and started carting away items he "thought" I didn’t need, well, he might have to pry some of them from my fingers while picking buckshot out of his you-know-what. Of course the Garbage Collector (sounds like some kind of 22nd century hit man) would have the power to suspend me (and all other human units of execution) so I’d be helpless to stop him.

    But how would he (why is it a he?) be able to tell if it was an item that I owned? What if I borrowed it from my neighbor? And if he started to cart it away and I woke up and objected "hey, that ain’t trash", would I be able to get it back (aka resurrect it)?

    Yeah, I like the idea of anthropomorphizing .NET – there’s no telling how far we can take this.

  10. What if Garbage Collection was like Garbage Collection?…

Skip to main content