Hi,
I'm on Linux and using Jack.
I'm creating a drum sequencer with Beads,
using the SamplePlayer object to play the drum sounds.
While the sequencer is running the memory is constantly going up
and eventually also Jack gets into trouble with the cpu load.
I've analysed a heapdump and noticed that the issue is the amount
of float arrays in bufferStore in AudioContext:

My code that is responsible for the issue:
public void messageReceived(Bead message) {
for (File sound : currentSound2data.keySet()) {
DrumPlayerData data = currentSound2data.get(sound);
if (!data.isMute()) {
for (int step : data.getSteps()) {
if (clockCounter == step) {
Gain g = new Gain(beadsJackPlayer.getAudioContext(), JACK_OUTPUTS,
data.getVolume());
SamplePlayer samplePlayer = new SamplePlayer(beadsJackPlayer.getAudioContext(),
SampleManager.sample(sound.getAbsolutePath()));
g.addInput(data.getOutIndex(), samplePlayer);
beadsJackPlayer.getAudioContext().out.addInput(data.getOutIndex(), g,
data.getOutIndex());
}
}
}
}
So for each loop and each step I'm creating a new Gain and a new SamplePlayer.
I've tried working around it by having having for each step 1 Gain and 1 SamplePlayer object and then setting the Gain and setting the sample, but then I get only sound during one loop.
Anybody with some help ?
Thanks
Regards