Hello Steve,
No no, your definitely not a pariah, and your emails are definitely
making it onto the list A crazy thought appears, perhaps woefully and
stupidly in my head, but, its 1AM EST here, so, forgive me for this,
but, why not simply use the design pattern of Singleton in
custom_require.rb if you believe this is the problem ?
There now follows a rather clunky 'human diff' .. please bear with
me
at line 24 (in the require method)
@gempath_searcher ||= Gem::GemPathSearcher.new
should become
@gempath_searcher = Gem::GemPathSearcher.instance
And then you want to change the module Gem part below to look
something like;
module Gem
require 'singleton'
#
# GemPathSearcher has the capability to find loadable files inside
# gems. It generates data up front to speed up searches later.
#
class GemPathSearcher
include Singleton
If you then put a 'puts @gempath_searcher.object_id' after the line
24 change, and run (say) your ruby ./script/server, you will see a huge
spew of lines like ;
stef@stef-desktop:~/work/myTest$ ruby ./script/server
-606820690
-606820690
-606820690
If you 'undo' those changes, and go back to the good old-fashioned
code, you will see something like;
stef@stef-desktop:~/work/myTest$ ruby ./script/server
-606681356
-606869086
-606681356
-606818976
Different object_id's means different object's .. so .. by using the
Singleton design pattern, your gemserver will now only be created
‘once’. Now, of course, wether or not this breaks things horrible OR if
this does indeed fix your memory leakage, you will have to let us all
know
Either way, have a nice night, I am shuffling off to bed, for some
well earned R&R. Let me know how it all works out though please,
irregardless
Regards
Stef
(ps. I could never worship Satan, but only Cthulhu, mean to say, why
worship a lesser evil ;D
(pps. that -is- a joke for the humour impaired