Here’s some pointers I’ve found helpful:
fork off child processes to do a lot of memory usage then die–that way you for sure reclaim that memory
use GC in another child process [email me for details]
Use temp files — Marshal.dump large quantities of data to them while you’re not using it, then Marshal.load it when it is desired.
slim_attributes helps with mysql related usage.
Here’s some more intense options:
rewrite erb to re-use strings
write a “slim array” that encompasses simple ints and strings and floats more memory efficiently than Ruby’s currently does.