[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: 'failed to allocate memory' with Mp3Info module

Berger, Daniel

3/22/2006 3:33:00 PM


> -----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:

<snip>

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