Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sound Leakage

Posted on 1998-05-08
3
Medium Priority
?
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 5

Accepted Solution

by:
fontaine earned 400 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

705 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