From: tsuraan Date: 2005-10-27T22:58:28+09:00 Subject: mod_ruby object persistence How long do objects stick around in mod_ruby? I have a really simple pair of files: countersingle.rb: ----- require 'singleton' class Counter include Singleton def initialize() @counter = 0 end def get() @counter += 1 end end ----- and counter.rhtml: ----- <% require 'countersingle' %> <%= Counter.instance.get %> ----- When I am refreshing the page, the count goes up. If I wait a minute or so, the count gets reset to zero. So, I'm wondering if there's some way to force persistence with mod_ruby, or is there a garbage collection that happens after a minute of inactivity that will always clear up everything that's not relevent anymore?