From: "Berger, Daniel" Date: 2006-03-23T00:33:10+09:00 Subject: Re: 'failed to allocate memory' with Mp3Info module > -----Original Message----- > From: list-bounce@example.com > [mailto:list-bounce@example.com] On Behalf Of firejdl > Sent: Tuesday, March 21, 2006 8:28 PM > To: ruby-talk ML > Subject: 'failed to allocate memory' with Mp3Info module > > > 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| > Mp3Info.open(f) do |info| > puts f > i += 1 > end > end > > 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: Looks to me like you're just running out of memory, since that line is just an IO#read. I think Mp3Info is not freeing the used memory between reads as it should, but I'd have to look at the source a bit closer. Regards, Dan