Solved

Sound Leakage

Posted on 1998-05-08
3
156 Views
Last Modified: 2010-04-16
In a game I play sounds with the AudioClip class. After 20-30 minutes the game suddenly crashes - the system memory is full. Do you know any workaround for this memory leakage problem?
0
Comment
Question by:bela
  • 3
3 Comments
 
LVL 5

Accepted Solution

by:
fontaine earned 200 total points
Comment Utility
I read several explanations for this phenomenon. It is a bug in fact and there is nothing you can do programmatically. Here are the interpretations.

1/ Every time that you are calling AudioClip.play(), another channel is opened by AudioDevice (which is part of the sun.audio package). No one knows when the clip is done playing, so it never gets removed from the Vector of channels that AudioDevice is keeping internally. The Vector thus gets longer and longer and finally there is no more memory.

2/ Sometimes, it appears that it fails to close the audio streams in the sound engine, what led to a memory leak when the sound file is played again and again.

My references are:

http://developer.java.sun.com/developer/bugParade/bugs/4072950.html

This is a page of the Java Developer Connection. To have access, you can register for free. If you go to the "Bugs" section and type AudioClip in the query you will have access to some stories similar to your one.
0
 
LVL 5

Expert Comment

by:fontaine
Comment Utility
0
 
LVL 5

Expert Comment

by:fontaine
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
firstChar challenge 13 83
Which is the latest version of Apache Tomcatl 3 35
maven project error 5 17
Java Timer (static) 9 5
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now