Mind Control Forums  

Go Back   Mind Control Forums > Public Categories > Hundred Miles Software > Hundred Miles Software: UltraID3Lib Support

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old January 3rd, 2010, 08:20 PM
Bob Bob is offline
Registered User
 
Join Date: Jan 2010
Posts: 1
Run out of memory?

I feel really simple, but I can not figure this out. When I run the following loop the memory just climbs and climbs until I run out of memory.

string[] files = Directory.GetFiles(dir, "*.mp3");
foreach (string songTitle in files)
{
this.myTagReader.Read(songTitle);
Song s = new Song();
s.Band = myTagReader.Artist;
s.DateRecorded = myTagReader.Year.ToString();
s.Title = myTagReader.Title;
this.myDataLayer.insertInitialSong(s, songID++);
this.myTagReader.Clear();
}

By the time I read 5000 songs or so I am hitting 1,889,020k Vitural Size in Process Explore and the PF Usage in Task Manager is over 2.0 GB. I have played around commenting lines in and out and it is the line this.myTagReader.Read(songTitle); that causes the memory to rise.

I tried the following:
using(UltraID3 myTagReader = new UltraID3 ()
{
foo
}

But ran against the not implicitly convertible to IDisposable.
Any suggestions appreciated.
cheers

bob
Reply With Quote
  #2  
Old January 5th, 2010, 07:51 PM
MitchHonnert's Avatar
MitchHonnert MitchHonnert is offline
Moderator
 
Join Date: Nov 2005
Location: Cincinnati
Posts: 642
You're creating a new instance of the Song class with each iteration. Maybe you could try using a single instance and implement a method similar to Clear and just clear out the property values of the Song instance on each iteration. Maybe try commenting out the Song code to see if it's the UltraID3 class that's causing the memory leak.

- Mitchell S. Honnert
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -5. The time now is 05:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
2003-2008 Rainlands