RubyGems dependency management and memory use... 8

Posted by Steve Longdo Tue, 08 Aug 2006 06:30:00 GMT

I've been looking into the nebulous matter of Rails memory management lately, using Typo4 as my model app. In my research thus far I have noticed that several of the highest memory using items are from the RubyGems library. Particularly the Gem::GemPathSearcher object. After running a few days I have picked up five instances of it taking up nearly 8MB of RAM which is odd because the first time I profiled it there were only four of them. I am not sure why RubyGems needs to be in memory after the app initially loads, especially the ~1.5MB SourceIndex and the 352 Gem::Specification objects for another ~1.6MB. Seems like wiring of any dependencies could be done once at start up. I am not sure if this relates specifically to how Typo uses RubyGems or if all Rails apps incur the memory overhead penalty for RubyGems. If any one with knoweldge of the internal functioning of RubyGems would take the time to educate me on this it would be much appreciated. Also if someone could explain why RubyGems pops up at all since all Typo dependencies are deployed into the vendor folder.

Another one to watch is the slow accumulation of ActiveRecord::ConnectionAdpaters::MysqlColumn, up to 217 instances in memory. Not a particularly large memory hit, but they have steadily grown in number over the last few days. i may swith over to my Postgres database and see if the same thing happens with its connecton adapter.

Finally the allocation of Array objects is interesting. The number of instances in use has gone down by roughly -2000 instances but the memory use of the remaining Arrays has gone up by about 2MB. I need to explode these Arrays and see what they hold and why they stick around so long. Partial output of profiling included below:

Class x852(21194)
Gem::Version x709(24981)
ActiveRecord::ConnectionAdapters::MysqlColumn x217(35410)
Regexp x1343(52312)
Gem::Dependency x309(53743)
Gem::Version::Requirement x662(59168)
Gem::SourceIndex x1(1563056)
Gem::Specification x352(1714117)
Hash x1257(1858255)
String x117204(3869923)
Gem::GemPathSearcher x5(7901012)
Array x6093(11102839)
TOTAL == 28496875

Please do share your experiences with Rails or RubyGems memory use in the comments.

Adobe Flex2 is out...

Posted by Steve Longdo Wed, 28 Jun 2006 15:58:00 GMT

Apparently Adobe Flex2 is available for download today.
When Adobe first announced Flex 2 last fall, it said that it would make the core software development kit (SDK), which provides the core programmer tooling without the bells and whistles of a visual IDE, available for free. The SDK just released includes the framework itself, compiler, documentation, and a command line debugger.
It would be great to be able to use the free SDK compiler to make a simple AJAX driven 3D pie-chart not unlike the ones in Google Analytics. Adobe even provides an open source Flash-Ajax bridge project for linking AJAX activity to a swf file.

Has someone already done this or am I ahead of the curve?

Spreading faster than the bird flu...

Posted by Steve Longdo Thu, 02 Mar 2006 03:07:00 GMT

Congratulations to Anchorage, Alaska for coming into the fold. Leaving just a few more states to go. As excited as I am to pick up another United State, something even cooler has happened: Norway. Thanks to the city of Bodø for stopping by.

Also a very special thanks to Shlomo(Toda Raba!, תודה רבה) for visiting from Israel!

So I think I am going to have reprioritize which countries to get to visit here next. I was thinking South America, but they are finding me on their own, Argentina, Brazil, and Chilé. Literally the ABC’s of South America have already stopped by. I would like to get a visit from Venezuela though. I traveled there many years ago. If anyone from there stops by I will try to find some of my old photos from Caracas and post them.

Geting visits from more countries that the US doesn’t get along with well would be neat. I noticed that I have had two visitors from Vietnam one even from Ho Chi Minh City. Strange to think about my father fighting there in the war and now people are beginning to exchange ideas and information again.

Next on the list Cuba, I am not sure what kind of internet access is allowed there, but I hope someone finds the way here. Visitantes agradables de Cuba.

I would be equally excited to pick up some traffic from the Korean Peninsula. Both North and South are welcome: 여보세요 한반도에서 방문자에.

Last but certainly not least Lichtenstein I am not sure if the anyone besides the Prince on the Hill has internet access there, but if so “Willkommen im voraus zu den Besuchern von Lichtenstein.” I think I have pictures from when I was there to post as well…

Yes I know the US gets along with South Korea and Lichtenstein… for now :-)
Steve Longdo World Domination Map
Click for larger size


UPDATE: I added lightbox capability to the Google Analytics Map so that you can see it at a larger size. Plus it is just that much more AJAX goodness.

I have also switched the site over to a modified version of Jamie Hill’s excellent Lucid theme from the Typo Garden contest. Leave a comment if you encounter any unusual errors while browsing the site, they are probably my fault from tinkering…

Read more...

Older posts: 1 2 3