memory leaks in Rails

3 views
Skip to first unread message

Saifi Khan

unread,
Feb 21, 2009, 2:16:09 PM2/21/09
to rub...@googlegroups.com
Hi all:

i'm keen to know, why there are memory leaks in Ruby on Rails
framework ?

All observations and thoughts are welcome.


thanks
Saifi.

Saifi Khan

unread,
Feb 25, 2009, 3:38:23 AM2/25/09
to rub...@googlegroups.com

suman karthik

unread,
Feb 25, 2009, 12:36:24 AM2/25/09
to rub...@googlegroups.com
Framework based Memory leak in a big project is a scary thing.
http://codehappy.wordpress.com/2007/01/17/tracking-a-memory-leak-in-rails/
--
-Suman
http://www.zerocaffe.in

Saifi Khan

unread,
Feb 25, 2009, 6:31:00 AM2/25/09
to rub...@googlegroups.com

leaking around 20,000 string objects every 10 seconds ! Wow !

If Ruby is such a fine language with "Mark and Sweep" method of
garbage collection, why is there a memory leak ?

Ruby has been around for 14 - 15 years and so it has been around
for the same number of years Java has been.

I'm sure i must be missing something here.
Btw, i'm a Ruby newbie.

thanks
Saifi.

suman karthik

unread,
Feb 25, 2009, 3:26:35 AM2/25/09
to rub...@googlegroups.com
Hey saifi,

Check this out. It details why and how memory leaks can occur.
http://whytheluckystiff.net/articles/theFullyUpturnedBin.html

As far as 10,000 strings leak is concerned it is not a rubyVM specific but was caused by a Plugin+Framework Mismatch.

Just like in ruby im sure anyone can cause memory leaks in any language be it java or C++ when they are not careful about
coding. Automatic garbage collection sometimes makes people take Memory management for granted.

Ruby is by no means as mature as java (VM implementation wise). The community is nowhere near large enough and the Core implementations are moving at snail's pace. Hoping someone would do a strongtalk VM kinda implementation for ruby but that's just wishful thinking.

and the 14-15 years were wilderness years for ruby just like they are for a lot of other languages that have been around for decades but nothing really happens for them. The last 4 years have been the real interesting ones where ruby emerged from a fun scripting language to tie stuff together to something with bigger plans.Anyway im rambling.......



--
-Suman
http://www.zerocaffe.in

Saifi Khan

unread,
Feb 25, 2009, 7:51:09 AM2/25/09
to rub...@googlegroups.com

Saifi Khan

unread,
Feb 25, 2009, 9:40:05 AM2/25/09
to rub...@googlegroups.com
On Wed, 25 Feb 2009, suman karthik wrote:

> Hey saifi,
>
> Check this out. It details why and how memory leaks can occur.
> http://whytheluckystiff.net/articles/theFullyUpturnedBin.html
>

> Just like in ruby im sure anyone can cause memory leaks in any language be
> it java or C++ when they are not careful about
> coding.
>

The minimum heap size in Ruby is 8 megabyte !
Isn't that a lot for a scripting language.

In a high-level scripting language like Ruby, memory leak is
unacceptable ! The entire purpose of high-level constructs is to
provide the developer a vehicle to express his intentions in
code and then the VM takes care of the rest.

In C++ memory leak is understandable because it is a programmer
mistake. C++ never claims to run a GC for you in the runtime.

I suspect this is a congenital defect in Ruby one that will
hinder it from gaining enterprise traction.

Time has come to design a new programming language :-)

thanks
Saifi.

suman karthik

unread,
Feb 25, 2009, 5:33:30 AM2/25/09
to rub...@googlegroups.com
spoken like a true hacker

hehehehe
--
-Suman
http://www.zerocaffe.in
Reply all
Reply to author
Forward
0 new messages