The Garbage Collector

[I just spent over a week hunting down the source of a memory leak in my company’s Android app. This evening, I discovered the culprit was an old and very subtle reference error that prevented garbage collection. While it had gone unnoticed for months, the effects were exacerbated after adding a new memory-intensive feature. I did a small rewrite and fixed it in half an hour. Ecstatic with the joys of victory, I wanted to tell my friends all about my harrowing journey of technical tribulation, but alas, they are not software engineers. So, I wrote this story to represent my mental struggle.]

Imagine that you get married and end up with 10 kids. You’re going through the diapers and wipes and food and everything else and creating tons of trash, so much so that the trash can is almost overflowing every couple of days. You think, “Man, I hope the garbage service picks up all this garbage. There’s so much of it!”

Then one day you look out in the yard after garbage day, and there’s still a bag of garbage sitting out by the street. You call the garbage service provider and ask them about it, and they just say that they took all the garbage they could. So you think, “Hmmm, that sucks, but it makes sense, because we’re creating so much garbage.”

Weeks pass by, and more and more garbage bags pile up outside until your front yard is basically a dump and the neighbors are about to sue you. You start looking for ways to make less trash, even though you can’t stop taking care of your kids or stop feeding them. You try using cloth diapers, and it’s really disgusting and takes a lot of effort to clean them. You think of other annoying and complicated ways to reduce your trash output, but you can’t get around the fact that you have 10 kids and they just create a lot of garbage.

You’re stuck with this same garbage service, and they just keep telling you the same thing. You can’t stop taking care of your kids, and you can’t move to another house because this one is unsellable with so much garbage in the yard. You are unable to get any help, and you can’t take it all to the dump because there isn’t one available. It’s stuck there. The neighbors have begun writing up their lawsuit. You feel that you have no options. You’re about to face the fact that maybe you can’t support 10 kids because they just create too much garbage for the garbage service to handle. You may have to put some kids up for adoption. It seems silly, but if you don’t, you’ll be sued and won’t be able to feed any kids at all. That thought makes you sick and you know your spouse will never forgive you, but you just can’t see any other option. There’s just too much garbage.

Then one day you’re dejectedly watching the garbage truck pick up most — but not all — of the garbage in your trash can, and you notice that the garbage truck isn’t overloaded. It could have taken on more, but it didn’t. Then you notice that the crew took all of your neighbor’s garbage, and they had way more out by the curb than you did. You call the collection company angrily, but they still tell you that they took everything they could.

Nearly beaten, you decide to start looking into the company’s pick-up policies, but they don’t have them on their website. You have to google around for hours, looking into garbage amount limits for some sort of explanation. Everyone says the same basic things, and it seems like you should be in the clear, but obviously you are not, because your yard is now a mountain of garbage and your kids are getting sick from all the trash everywhere.

Finally, you come across some long-abandoned post from 15 years ago on a random city forum that says the garbage company will not pick up any bags of trash that are not sealed. You think to yourself, “I seal all my bags of trash.” But then you think again. You recall that there are bags of trash from the bathroom waste basket, and they aren’t sealed, but they are inside the big bags of trash (which are sealed). It seems silly, but technically, even though you are sealing the bags that you take out to the curb, there are still bags of trash inside those bags that are not sealed. You think, “Surely that doesn’t matter. Their policy does say that they won’t take any unsealed bags of trash, but surely they just refer to the bags they have to pick up at the curb and not the bags inside those bags.”

The next day, out of desperation, you start sealing all the bags of trash from the waste baskets before tossing them in the bigger kitchen trash bags. Feeling stupid for even trying this idea, you take the kitchen trash bag to the curb on garbage day. You do the same for all the rest of the trash bags, making sure any smaller bags inside are also sealed. The garbage truck comes by, and astoundingly, they take every single bit of your garbage for the first time in months. You start crying because you are so happy. You go back to the mountain of garbage and begin sealing all bags of trash, opening the bigger bags and sealing the smaller waste basket bags inside them, then resealing the big bags again. The next week, the garbage truck comes by and takes every single rotting bag of trash from your yard. All of it. Your yard is a festering lot of brown, smelly, greasy dirt, but all the garbage is gone.

Finally, you are free. You can live again.