Forum: Ruby 'failed to allocate memory' with Mp3Info module

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
firejdl (Guest)
on 2006-03-22 05:27
Hey all:

I'm pretty new to Ruby [this is my second script], but I'm trying to
write a little playlist generator script to scan a few directories every
once in a while [probably in a cron job], and update a .m3u playlist
based on what it finds. I like having info in my playlist so it loads
automatically with the playlist, so I'm trying to use the Mp3Info
module. I've got my list of files in an array called files. Here's the
code I'm using to test things out:

i = 0
files.each do |f| do |info|
    puts f
    i += 1

i is just to see how far it's getting, and puts f is just to see what
the particular song is.

It runs just fine, up to i=32. At that point, it errors out, with:
`read': failed to allocate memory (NoMemoryError)
        from ./playlistgen.rb:48
        from ./playlistgen.rb:47

Am I doing things wrong? Or is it just running out of memory? If it's
the latter, is there any way to expand the amount of memory for
Ruby/Mp3Info to use?

All I really want to do is get the song length, artist and
there any better way to do it?


PS. I'm using Ruby 1.8.3 and Mp3Info 0.5 on AMD64 with the patch at
This topic is locked and can not be replied to.