Hi,
I filed a bug report with two patches for using toggle references for
the GObject memory management in ruby-gnome2. I just thought I’d send a
note to this list as well in case the Bugzilla isn’t often checked.
https://sourceforge.net/tracker/?func=detail&aid=3012947&group_id=53614&atid=470969
Has this been discussed anywhere before? It seems like it would be more
robust than having to walk the entire hierarchy of objects in the mark
phase. As far as I can see Ruby is unique in using this method to bind
GObjects. pygtk, gjs, seed, Gtk# and java-gnome all use toggle
references.
Regards,
Hi,
In [email protected]
“[ruby-gnome2-devel-en] Toggle references” on Tue, 08 Jun 2010
12:17:49 +0100,
Neil R. [email protected] wrote:
references.
If the method is a better method rather than the current
method, we will use the method. Did you confirm that your
patches don’t cause new SEGVs and/or memory leaks? If you
already confirmed it, please show the detail. If you need
more time to confirm it, you can do it in the official
repository.
Thanks,
kou
Neil R. [email protected] wrote:
I filed a bug report with two patches for using toggle references…
Kouhei S. [email protected] wrote:
If the method is a better method rather than the current method, we
will use the method. Did you confirm that your patches don’t cause new
SEGVs and/or memory leaks? If you already confirmed it, please show
the detail. If you need more time to confirm it, you can do it in the
official repository.
I did some minor testing to confirm that it doesn’t memory leak by
creating a simple script and stepping through it with GDB to check that
the ref counts are correct and that the mark phase is executed. I also
ran it with gtk-demo and it didn’t seem to cause any problems. Of course
it’s quite a tricky thing to be sure about so I may have missed
something. Are there any standard tests with ruby-gnome2 to stress the
ref counting?
I will try to make a more formal test with a write-up when I get the
chance.
Thanks
Hi,
In [email protected]
“Re: [ruby-gnome2-devel-en] Toggle references” on Tue, 08 Jun 2010
14:08:07 +0100,
Neil R. [email protected] wrote:
it’s quite a tricky thing to be sure about so I may have missed
something. Are there any standard tests with ruby-gnome2 to stress the
ref counting?
I will try to make a more formal test with a write-up when I get the
chance.
There are no standard tests to stress the ref counting but I
use the following test:
- select an application (e.g. demo.rb. See also
http://ruby-gnome2.sourceforge.jp/hiki.cgi?Applications
I’m using Rabbit for it.)
- create stress.rb that has the following content:
Thread.new do
loop do
GC.start
sleep 1
end
end
- run an application with the following command:
% ruby -I. -r stress application.rb
The above test will stress to application.rb. You may find
some bugs with a standard application usage on the stress
environment.
Thanks,
kou