Hi. I’m having a problem with a Ruby-Gnome2 application I’ve been
building. For some reason my program randomly segfaults. I fixed this
by disabling garbage collection(Maybe GC was cleaning up gnome objects
that were still in use?) but of course now my application runs out of
memory relatively quickly (not so much from the gtk objects, but from my
non-gnome objects that are memory hogs that need garbage collection).
I was wondering if there is any known reasons that the garbage
collection might cause problems with ruby-gnome2, and if there are any
workarounds I might employ to avoid them besides disabling my garbage
collection?
On Wed, Jun 13, 2007 at 07:46:55PM +0200, Conan wrote:
I was wondering if there is any known reasons that the garbage
collection might cause problems with ruby-gnome2, and if there are any
workarounds I might employ to avoid them besides disabling my garbage
collection?
I guess you’re still using Ruby-Gnome2 version 0.15, which had lots of
errors
related to memory management. You should upgrade to 0.16.
FYI, you can also manually run garbage collection with GC.start.
Cheers,
Markus
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
To trigger a segfault, just run this code and click furiously on the
listbox. After a while(10 seconds of furious mouse clicking) it’ll
segfault on my computer. I’m running ruby 1.8.2 on a windows 32 bit
machine with ruby-gnome2-0.16.0-1(Windows installer)
#Contrived example to get a segfault bug
require ‘gtk2’
#Fill up the list box
def fill_box(model)
[‘Stuff’,‘More Stuff’,‘Cool Stuff’,‘Lame stuff’].each do |l|
iter = model.append
iter[0] = l
end
end
Hmm, maybe thats the case then. I’ll give it a shot and see what
happens. (Also, try changing the 100 to 1000 or 10000, that reduces the
number of furious clicks needed)
Daniel L. wrote:
After about a minute of clicking as fast as I possibly could, I started
to consider the possibility that you were having a little fun with me.
Sorry, no segfaulting. Have you tried running with Ruby 1.8.6? I have
used another C extension that segfaulted until I upgraded.
Yeah, your right. Upgrading to Ruby 1.8.6 seems to have solved the
problems. Great, thanks for your help!
Conan R. wrote:
Hmm, maybe thats the case then. I’ll give it a shot and see what
happens. (Also, try changing the 100 to 1000 or 10000, that reduces the
number of furious clicks needed)
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.