Monthly Archive for: ‘January, 2009’

 

PET Scan #7

Went for PET scan #7 last week, and my doctor this week said it was completely clean, as expected. I’m now switching to twice a year for future scans. It was a little over two years ago that I had my Crohn’s surgery and started chemo, but it feels like forever — which is fine by me!

Fortunately, my Crohn’s has also been completely gone since the surgery, so for the last 18 months I’ve been healthier than any time in the last 20 years. The only undesirable side-effect of having working intestines is that actually digesting my food has caused me to gain considerable weight — 30 pounds compared to where I’ve been the last 10 years or so. This year I’m making some lifestyle changes… I’m not calling it a diet since diets tend to be temporary things. We’ll see how it goes, but the goal is to exercise more and eat healthier in general. It’s only been 1-2 weeks so far, but by writing it down here, I’m creating more incentive to continue.

 

Ruby memory leakage

I’ve been working on a Ruby on Rails web application to track and compare Xbox player scores and achievements—a direct ripoff of a similar Perl/Mason app that Ty wrote. I recently discovered that the web site started getting very slow to respond, and Ruby was using up lots of memory.

I did a fair bit of Google research into memory usage and garbage collection in Rails, but couldn’t find any smoking gun. I did come across a really tiny Memory Usage Logger for Rails, that just adds the process memory size to the server log after each request. I added this handy code, and used the Apache Benchmarking Tool to send several hundred web requests to my app, and graphed the results. Memory was definitely increasing linearly with the number of requests.

After doing some basic troubleshooting and code analysis, I was getting nowhere. Instead, I created a new, simple Rails app. Just an empty app, with one model and controller generated with Rails’s scaffolding and default views. This exhibited the same ever-growing memory problem. Weird. Rails is used widely for major web sites, so I knew this couldn’t be a widespread problem. I next installed Ruby Enterprise Edition, which was fortunately a fast and painless process. When I restarted my application and re-ran my stress test, memory was completely flat!

Google Chart

I notice now that although both versions of ruby (standard and Enterprise Edition) are version 1.8.6, they are different patchlevels, so I’m not sure if the memory fix is due to REE or due to some more recent ruby patches. Either way, I’ll probably stick with REE in the future.

ruby-versions