I see that this problem was noted a while ago (http://rubyforge.org/ tracker/index.php?func=detail&aid=251&group_id=35&atid=218) but it seems not to have received much attention. Any chance that it will be looked at anytime soon? So far, I prefer wxRuby to Ruby/Tk because of that closer coupling with the native window manager. However, the memory leak is just murdering me. Unfortunately, I cannot merely load and cache bitmaps easily as I am modifying them (drawing text on them) at run time. While I could cache the unique bitmaps with the drawn text, it seemed more of a nuisance than it was worth. Evan Light IMs (all): sleight42 http://evan.tiggerpalace.com _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Evan Light wrote:> I see that this problem was noted a while ago > (http://rubyforge.org/tracker/index.php?func=detail&aid=251&group_id=35&atid=218 > <http://rubyforge.org/tracker/index.php?func=detail&aid=251&group_id=35&atid=218>) > but it seems not to have received much attention.Don''t know about the other devs, but I''d forgotten this bug mentioned any specific issue rather than ''we should check for memory leaks''. Bugs related to over-eager SWIG/Ruby memory management have had higher priority because they cause segfaults. SWIG/Ruby was pretty underdeveloped when this bug was created, but features added since should make it a lot easier to reclaim objects that have fallen out of scope.> Any chance that it will be looked at anytime soon?Yes. Thanks for the report. Since Bitmap is such a widely used class that we should try and fix this specific one for the upcoming 0.40 release. Generally, please do file leaking classes as specific bugs, ideally with code samples.> Unfortunately, I cannot merely load and cache bitmaps easily as I am > modifying them (drawing text on them) at run time. While I could > cache the unique bitmaps with the drawn text, it seemed more of a > nuisance than it was worth.wxRuby should definitely be doing the work, not you. Are you using MemoryDC? alex
On May 2, 2007, at 4:57 AM, Alex Fenton wrote:> wxRuby should definitely be doing the work, not you. >I certainly appreciate the ethic. ;-)> Are you using MemoryDC?By way of using the DC provided by the yield call within Bitmap#new, yes. Evan Light IMs (all): sleight42 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070502/2458c67e/attachment.html
Evan Light wrote:> On May 2, 2007, at 4:57 AM, Alex Fenton wrote: > >> wxRuby should definitely be doing the work, not you. >> >> > > I certainly appreciate the ethic. ;-)I''ve tracked down why Wx::Bitmap is leaking. There''s an important fix to be made that will improve wxRuby2 memory usage across the board, but applying it is likely to destabilise other things for a bit. So I''m minded to attempt it after releasing 0.40 so we can existing improvements out there. I can probably give you an interim patch just for Wx::Bitmap if needed and you''re willing to compile. alex
Definitely. The application that I''m working on, an alternate accessible front end for Skype on Mac OS X, promises to benefit a lot of people. It will be a more effective front end for folks if I can use the wxRuby "EX_METAL" style to hide the window controls. I have no idea how to do that with Ruby/Tk. On May 3, 2007, at 4:34 AM, Alex Fenton wrote:> Evan Light wrote: >> On May 2, 2007, at 4:57 AM, Alex Fenton wrote: >> >>> wxRuby should definitely be doing the work, not you. >>> >>> >> >> I certainly appreciate the ethic. ;-) > I''ve tracked down why Wx::Bitmap is leaking. There''s an important > fix to > be made that will improve wxRuby2 memory usage across the board, but > applying it is likely to destabilise other things for a bit. So I''m > minded to attempt it after releasing 0.40 so we can existing > improvements out there. I can probably give you an interim patch just > for Wx::Bitmap if needed and you''re willing to compile. > > alex > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-usersEvan Light IMs (all): sleight42 Skype-In: (703) 531-8484 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070503/46f0d9ff/attachment.html
Evan Light wrote:> Definitely.Evan - I think this patch should resolve memory usage with Wx::Bitmap. No warranty if it melts your Apple, but let us know how it goes. Hopefully we can generalise this and integrate it before too long.> The application that I''m working on, an alternate accessible front end > for Skype on Mac OS X, promises to benefit a lot of people. It will > be a more effective front end for folks if I can use the wxRuby > "EX_METAL" style to hide the window controls. I have /no idea/ how to > do that with Ruby/Tk.Sounds really interesting. Similarly being able to use the small and mini control variants on OS X is a big sell for me a -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: bitmap_gc_fix.patch Url: http://rubyforge.org/pipermail/wxruby-users/attachments/20070504/b59664bb/attachment.pl
And here I thought that I was going to have to do a build! I''ll give it a shot. Thanks! On May 4, 2007, at 4:08 PM, Alex Fenton wrote:> Evan Light wrote: >> Definitely. > Evan - I think this patch should resolve memory usage with > Wx::Bitmap. No warranty if it melts your Apple, but let us know how > it goes. Hopefully we can generalise this and integrate it before > too long. >> The application that I''m working on, an alternate accessible front >> end for Skype on Mac OS X, promises to benefit a lot of people. >> It will be a more effective front end for folks if I can use the >> wxRuby "EX_METAL" style to hide the window controls. I have /no >> idea/ how to do that with Ruby/Tk. > Sounds really interesting. Similarly being able to use the small > and mini control variants on OS X is a big sell for me > > a > Index: swig/fixdeleting.rb > ==================================================================> --- swig/fixdeleting.rb (revision 1001) > +++ swig/fixdeleting.rb (working copy) > @@ -55,7 +55,8 @@ > found_director_constructor = true > end > # class specific constructor > - if(line.index(director_class_name+"::"+director_class_name)) > + if(line.index(director_class_name+"::"+director_class_name)) and > + director_class_name != ''SwigDirector_wxBitmap'' > # make a note of this object > lines = [line] > lines << ''#ifdef wxDEBUG'' > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-usersEvan Light IMs (all): sleight42 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070504/bf670623/attachment-0001.html
Evan Light wrote:> And here I thought that I was going to have to do a build! I''ll give > it a shot.Sorry, I should have explained - this patches one of the build process files. You''d need to download the source tar.gz, apply this patch, then compile for it to work. If you haven''t got the build kit set up already, I''d suggest waiting a few days to 0.40 is out, otherwise you''ll have to install different versions of wxWidgets. alex
If it''s coming in a few days, I can wait. Glad to hear that you may have found it, though. While I may have to write more code for Wx, I prefer the result over Tk. On May 5, 2007, at 4:42 AM, Alex Fenton wrote:> Evan Light wrote: >> And here I thought that I was going to have to do a build! I''ll give >> it a shot. > > Sorry, I should have explained - this patches one of the build process > files. You''d need to download the source tar.gz, apply this patch, > then > compile for it to work. > > If you haven''t got the build kit set up already, I''d suggest waiting a > few days to 0.40 is out, otherwise you''ll have to install different > versions of wxWidgets. > > alex > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-usersEvan Light IMs (all): sleight42 Skype-In: (703) 531-8484 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070505/3584a499/attachment.html
I''ve got the beta of my Skype app ready to go. I just need that 0.40 release. Very tempted to do a build myself. Is the environment that painful to set up the first time? BTW, if you''ve never tried it rubyscript2exe is a wonderful thing! On May 4, 2007, at 4:08 PM, Alex Fenton wrote:> Evan Light wrote: >> Definitely. > Evan - I think this patch should resolve memory usage with > Wx::Bitmap. No warranty if it melts your Apple, but let us know how > it goes. Hopefully we can generalise this and integrate it before > too long. >> The application that I''m working on, an alternate accessible front >> end for Skype on Mac OS X, promises to benefit a lot of people. >> It will be a more effective front end for folks if I can use the >> wxRuby "EX_METAL" style to hide the window controls. I have /no >> idea/ how to do that with Ruby/Tk. > Sounds really interesting. Similarly being able to use the small > and mini control variants on OS X is a big sell for me > > a > Index: swig/fixdeleting.rb > ==================================================================> --- swig/fixdeleting.rb (revision 1001) > +++ swig/fixdeleting.rb (working copy) > @@ -55,7 +55,8 @@ > found_director_constructor = true > end > # class specific constructor > - if(line.index(director_class_name+"::"+director_class_name)) > + if(line.index(director_class_name+"::"+director_class_name)) and > + director_class_name != ''SwigDirector_wxBitmap'' > # make a note of this object > lines = [line] > lines << ''#ifdef wxDEBUG'' > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-usersEvan Light IMs (all): sleight42 Skype-In: (703) 531-8484 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070506/e6841ec2/attachment.html
Evan Light wrote:> If it''s coming in a few days, I can wait. Glad to hear that you may > have found it, though.The source tarball for 0.0.40 is available now; binary builds to follow - I''ll make an announce when they''re all up. The compile toolkit''s not so hard to install, just quite a lot of compiling the first time around.> While I may have to write more code for Wx, I prefer the result over Tk.Have you tried using WxSugar - it''s intended to reduce the verbosity of wxRuby code - I find it takes about 30% fewer lines to do the same thing. alex
On May 7, 2007, at 4:46 PM, Alex Fenton wrote:>> While I may have to write more code for Wx, I prefer the result >> over Tk. > Have you tried using WxSugar - it''s intended to reduce the > verbosity of > wxRuby code - I find it takes about 30% fewer lines to do the same > thing.That''s what I get for not RTFMing enough on the main page of the site! Indeed, no, I have not! Evan Light IMs (all): sleight42 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070507/284387ce/attachment-0001.html
Confirmed that it is a memory leak with Bitmap or BitmapButton. Now that I''m caching the buttons as I create them, no more leak. Evan Light IMs (all): sleight42 http://evan.tiggerpalace.com On May 2, 2007, at 4:57 AM, Alex Fenton wrote:> Evan Light wrote: >> I see that this problem was noted a while ago >> (http://rubyforge.org/tracker/index.php? >> func=detail&aid=251&group_id=35&atid=218 >> <http://rubyforge.org/tracker/index.php? >> func=detail&aid=251&group_id=35&atid=218>) >> but it seems not to have received much attention. > Don''t know about the other devs, but I''d forgotten this bug mentioned > any specific issue rather than ''we should check for memory leaks''. > > Bugs related to over-eager SWIG/Ruby memory management have had higher > priority because they cause segfaults. SWIG/Ruby was pretty > underdeveloped when this bug was created, but features added since > should make it a lot easier to reclaim objects that have fallen out of > scope. >> Any chance that it will be looked at anytime soon? > Yes. Thanks for the report. Since Bitmap is such a widely used class > that we should try and fix this specific one for the upcoming 0.40 > release. > > Generally, please do file leaking classes as specific bugs, ideally > with > code samples. >> Unfortunately, I cannot merely load and cache bitmaps easily as I am >> modifying them (drawing text on them) at run time. While I could >> cache the unique bitmaps with the drawn text, it seemed more of a >> nuisance than it was worth. > wxRuby should definitely be doing the work, not you. > > Are you using MemoryDC? > > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070525/29c5192a/attachment.html