Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
app consumes memory then feezes

Rob
Guest
Quote
2014-03-10 03:17:09

I am having a problem with a .net desktop application using IrrKlang. The quick overview of the app is: user clicks a button, then app plays wavfile once. The problem I am seeing is after a week or so running fine the app starts consuming memory until it keeps looping in the while loop below.

I am certain that the freeze occurs in the while loop, I added logging and the results showed the application stayed in the while loop. I have checked the wavfile and it is valid and plays correctly outside the app.

Do I need to irrKlangEngine.Dispose(); after exiting the while loop? Shouldn't this already be taken care of?

Any thoughts or suggestions would be appreciated.




if (comboBox1.SelectedIndex > -1)
{

IrrKlang.ISoundEngine irrKlangEngine = new IrrKlang.ISoundEngine(IrrKlang.SoundOutputDriver.AutoDetect,
IrrKlang.SoundEngineOptionFlag.DefaultOptions,
sdl.getDeviceID(comboBox1.SelectedIndex));


irrKlangEngine.Play2D(WavFile, false);
while (irrKlangEngine.IsCurrentlyPlaying(WavFile))
{

}


}



niko
Moderator
Quote
2014-03-10 20:46:51

You could try that, maybe it helps. By the way, I hope this isn't actually the code how you are doing it. The while() loop should at least do something like a Sleep(), so that your CPU resources aren't wasted, and you are heating it up quite much then. :)


Rob
Guest
Quote
2014-03-11 08:25:44

I'll find out if the dispose ends up working next week but I think there is something else going on. Any other suggestions?

Since this application runs 24/7 and there are probably only 100 or so 30sec wavs played during a day, basically the app is sitting idle (other than db calls to see if there is a new wav. Would there be a need for a gc.collect?

Sadly, that is the actual code. The empty while loop stood out the first time I saw it. I did not develop it, I am only trying to troubleshoot why a simple application crashes after 1 week of running.


niko
Moderator
Quote
2014-03-12 06:06:54

Yes, you could also try doing gc.collect.

Another way would be to only use one irrKlang device (create it globally, and reuse it), and after you are finished playing one sound, call removeAllSoundSources().


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact