Skip to content

Instantly share code, notes, and snippets.

@wvengen
wvengen / README.md
Last active January 15, 2026 11:08
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

# There is some interesting magic going on regarding time zones in Rails, even more
# so in Rails 3. The easiest is to talk in UTC to your database and any other service
# you might consume, but we're stuck with a legacy schema that stores Irish time
# without time zone information.
#
# With these settings, ActiveRecord assumes that what is in your DB is in local time,
# and the local time zone is configured to be Dublin, i.e. IST (Irish summer time)
# in summer, UTC (in Ruby still referred to as GMT) in winter.
# When writing to the DB times will first be converted it to Irish time (if it's not already).
# When reading no conversion happens but the time zone is set as being IST/GMT.

RubyConf Taiwan 2014 Schedule

2014/4/25 (Fri.)

Period Auditorium Performance Hall
@adrienbrault
adrienbrault / purge.sh
Created September 24, 2012 10:02
Script to reduce VM size before packaging for vagrant
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5