Steffen Hi, the name's Steffen and I'm writing about the Web, programming and all those things coming to my mind. Enjoy your stay.

I'm currently working on fabidoo.com - 3D Printing for everyone!

Archive for the ‘Ruby on Rails’ Category

Memory Leaks in GetText for Ruby on Rails

Saturday, March 22nd, 2008

Version 1.90.0 of GetText for Ruby has quite some memory leaks in its Rails support files. In my case, the memory Mongrel used increased by 1 MB with each request it served… Quite amazing that you don’t really find someone else having the problem… Well there’s at least a bug report on rubyforge…

Monkey-patching gettext.rb with the following code made things quite more relaxed:

  def bound_target(klass = self) # :nodoc:
    ret = nil
    if klass.kind_of? Class or klass.kind_of? Module
      ret = klass
    else
      ret = klass.class
    end
    ret = GetText if ret.name =~ /^\#<|^$/
    ret
  end

The memory usage grows extremly slow now and is acceptable for our current web site traffic.

Plus: It helps to “every now and then” call GetText.clear_cache - which I don’t like because you have to do it “manually”. It would be much better if GetText did its own garbage collection …

Tags: , , ,

Ruby on Rails: gettext + memcache = trouble

Saturday, September 29th, 2007

The latest Ruby gettext 1.10.0 gem broke the memcache based fragment caching of the current project I’m working on. I figured out what the problem was. gettext 1.10.0 tries to localize caching of fragments by kind of appending the Locale.current to the fragment cache key, e.g. “items/show/1″ becomes “items/show/1_en”, “items/show/1_de”, …

This by itself isn’t a problem but gettext also overwrites the default Rails implementation for expiring fragments. The gettext mechanism expires each localized cache fragment for a given key, e.g. “items/show/1_*” (where * is a wildcard). The current memcache-client gem (1.5.0) however doesn’t support wildcard based key access and a “delete_if method not defined” exception gets thrown.

(more…)

Developers are Musicians

Thursday, February 15th, 2007

Some random (and slightly interpreted) quotes by Ryan McMinn of unspace.ca, a Canadian project company:

  • Specs = Speculations
  • Contracts induce Software that works but sucks
  • Developing Software is getting a career option
  • Developers are Musicians

Check out the video - it’s 15 minutes full of truth ;-)

Tags: , , ,

You are currently browsing the archives for the Ruby on Rails category.

18268