Forum: Ruby RubyTorrent memory usage

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Edwin V. (Guest)
on 2006-05-08 02:19
Hi all,

I've been using the rubytorrent library to build a webbased torrent
client, but when I start a torrent ruby wll slowly start using more and
more memory and in about three hours it will use 100% (512mb) of memory.
The package seems unmaintained (no activity the last year and no reply
to email) so basically two questions:

1) Does anyone here use rubytorrent. Do they have the same problems or
is it just me.

2) How would I debug this. I looked into the creation of objects by the
library (by monitoring objectspace) and it mostly creates Arrays and
Procs (Arrays go from 40000 at the start to 400000 after half an hour),
but the number of objects based on the rubytorrent classes stays about
the same. Is there a way to find out by which object another object is
created; for example have an object report it has been created by
RubyTorrent::Peer.

Edwin

P.S. this is on ruby 1.8.4 in linux.
Logan C. (Guest)
on 2006-05-08 02:44
(Received via mailing list)
On May 7, 2006, at 6:19 PM, Edwin van Leeuwen wrote:

> 1) Does anyone here use rubytorrent. Do they have the same problems or
> RubyTorrent::Peer.
>
> Edwin
>
> P.S. this is on ruby 1.8.4 in linux.
>
> --
> Posted via http://www.ruby-forum.com/.
>

It's probably the Procs that are causing the "leak". Blocks grab
their _entire_ environment so that code like
proc { eval(...) }
doesn't break

The "problem" is that as long as it is possible to reference that
proc, it is possible to reference everything in that proc's enclosing
scope.
This topic is locked and can not be replied to.