Solved

Sound Leakage

Posted on 1998-05-08
3
157 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
ID: 1220824
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
ID: 1220825
0
 
LVL 5

Expert Comment

by:fontaine
ID: 1220826
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
network + 7 80
why cannot we forward request once the response is committed 2 33
Spring Framework HTTPSession management 1 21
MySQL  on Tomcat 8 24
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

932 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

10 Experts available now in Live!

Get 1:1 Help Now