I’ve been giving Ruby and JRuby all the love lately, but tonight is Java’s night:
A Java program, if reasonably well designed, can be a joy to maintain.
I spent the last couple of days hunting down a memory leak in our server app. Finding the memory leak really sucked, but here’s where it gets good. The leak was in a single object, used for caching. Fixing it involved replacing the standard collections with WeakReference based collections. Since the program used the Collections interfaces, I only had to change the instantiations. That’s it. Game over.
Now, since the program is reasonably well designed, there are unit tests available, so I can verify that my fix didn’t break anything else. Also, now that the garbage collector is able to get its job done, the application seems to be performing better (and, of course, not crashing).
Weak is Good.





0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment