From: "Kroeger, Simon (ext)" Date: 2006-07-24T22:45:34+09:00 Subject: Re: GC in C extension.... > From: jared.r.richardson@gmail.com > [mailto:jared.r.richardson@gmail.com] > Sent: Monday, July 24, 2006 3:20 PM > > Here's a follow-on then.. my program is now running great but leaking > lots of memory. :) Because it's a database driver, it doesn't > terminate > but rather runs for a very long time. > > Declaring the variable as rb_global_variable prevents Ruby > from garbage > collecting it. How do I release it back to Ruby again? Is there a > rb_unset_global_variable? Not that I know of, but use a global array or hash and put everything you want to keep in it. Inserting and deleting from a hash should be even faster than rb_global_variable. cheers Simon