Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

OutOfMemoryError when playing Audio Files

 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !

I am experimenting with Mobile Media API. Its a simple midlet. The user can 'repeatedly' play audio files. They are in MIDI format. Size is around 2.5 K.

I am getting an OutOfMemeoryError if I play sounds, 10 or 15 times repeatedly. Do you think that audio files consume lot of memory ?

Danish
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently you have a memory leak of some sort. Could you describe how the (re)play function is implemented and how do you cleanup?
 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was not calling the player.close() method. It releases resources. Now its working fine.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!