From: Sean Chittenden Date: 2002-05-10T08:29:21+09:00 Subject: Re: rb_unload() ? > I'm experimenting with using ruby as embedded scripting language, > but I've run across a problem. I don't want things to stay resident > after I'm finished with a file. Is there something like rb_unload > or rb_flush that won't uninitialize ruby but will remove all defined > classes, functions, and variables from memory? Even better if > there's a way to keep constants resident. Please see mod_ruby and the way that it handles this with garbage collection. There is no way to do this from the script side as far as I can tell. You can't unload shared objects yet. knu and I had an interesting discussion about that on IRC and I was going to play around with trying to integrate how apr handles this. Under APR/Apache the memory never gets freed for shared objects, instead the pointer to the shared object resource gets moved to a new location where the memory exists. I believe that it is possible to unload a DSO under FreeBSD (maybe linux), however there is no cross platform way of accomplishing this. hth -sc -- Sean Chittenden