SillyDude
2007-Nov-08 04:35 UTC
mysql-ruby gem using significantly more memory that mysql.rb ?
I have found that, using the mysql-ruby gem leads to 40 MB more memory consumption in my tests than plain mysql.rb. Is anyone aware of this? My test loads a nasty grid of values using many include statements which result in about 5000 rows being returned (the actual number of rows is much less but the joins increase the number). When using ruby-mysql: The memory usage jumps from ~75megs to 161megs after executing result.all_hashes and does not go back down. When using mysql.rb: The memory usage jumps from ~75megs to 121megs after executing result.all_hashes and does not go back down. I have two major concerns.... 1.) why doesn''t the process eventually release the memory that is used up? I am destroying all references to the grid and calling GC.start to be sure 2.) why does ruby-mysql use significantly more memory than mysql.rb? I appreciate any help and will continue investigating on my own in the mean time. (I already posted this in the core list, but realized that since I don''t have a fix yet and since mysql-ruby is outside of rails it would probably be more appropriate here.) Thanks, Kris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Roderick van Domburg
2007-Nov-08 13:44 UTC
Re: mysql-ruby gem using significantly more memory that mysq
Hi Kris,> I have found that, using the mysql-ruby gem leads to 40 MB more memory > consumption in my tests than plain mysql.rb. > > Is anyone aware of this?Yeah, MySQL/Ruby is known to create an overly amount of garbage. Stefan Kaes has a patch for it [1] and I provide a compiled set of MySQL/Ruby adapters for Windows that have got this patch [2]. [1] https://railsexpress.de/blog/articles/2006/10/05/make-ruby-mysql-create-less-garbage [2] http://www.vandomburg.net (currently migrating to another host; adapters will be back up soon) -- Roderick van Domburg http://www.nedforce.com -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bob Showalter
2007-Nov-08 14:14 UTC
Re: mysql-ruby gem using significantly more memory that mysql.rb ?
On Nov 7, 2007 11:35 PM, SillyDude <kristopher.rasmussen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 1.) why doesn''t the process eventually release the memory that is used > up? I am destroying all references to the grid and calling GC.start to > be sureGC returns the memory to the internal free pool, but the memory is never returned to the operating system. This isn''t a Ruby-specific thing; most programs work the same way. The only way to accomplish that is to have the program re-exec itself. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---