I've been working with dynamically changing volume based on the distance between two characters:
double dist = Math.sqrt((Math.pow((MazeWorld.Play1.xPos-xPos),2)+Math.pow((MazeWorld.Play1.yPos-yPos),2)))/Math.sqrt(2*Math.pow(MazeWorld.size,2));
Open.setVolume((int)(100-(dist*60)));
Close.setVolume((int)(100-(dist*80)));
and fairly quickly run out of memory. Is this a known problem, or am I doing something wrong?