.

Coffee Powered

code and content

Monthly Archives: August 2010

Debugging memory leaks in Ruby with GDB, round 2.

In part 1, I described how I located leaky Sets in MongoMapper by diffing the Ruby ObjectSpace with GDB. Today, I’m going to show you how to solve the problems that those sorts of diffs can reveal. In today’s example, we’re tracking leaky sets. In particular, a set is holding onto class references. We are [...]

MongoMapper, Development Mode, and Memory Leaks

If you’ve worked with MongoMapper for a while, you’ve probably noticed that in complex apps, there are horrific memory leaks in development that magically disappear in production mode. While this is all well and good, and it’s rather handy that things Just Work in production, don’t you wish you didn’t have to restart your app [...]

WillPaginate and custom paging.

will_paginate is the de facto Rails paging plugin, and with good reason – it’s solid, fast, and reliable. Everyone I know uses it, but a lot of people don’t use it to its full power. I recently discovered some very cool functionality it includes – the WillPaginate::Collection class can be used as a custom paginator [...]

Setting up replica sets with MongoDB 1.6

Introduction MongoDB 1.6 was released today, and it includes, among other things it includes support for the incredible sexy replica sets feature – basically master/slave replication on crack with automatic failover and the like. I’m setting it up, and figured I’d document the pieces as I walk through them. My test deploy is going to [...]

Click mapping with HTML5 and node.js

I was recently in need of a click mapping solution, and didn’t like most of the solutions I came across. They had huge dependency chains and were generally unwieldy, or they didn’t work that well, or they were external services that I had to pay for…until I ran across heatmapthing. Now we’re talking. Client-side rendering [...]