alBufferData seems to allocate memory outside JVM and never release

Started by Estraven, May 26, 2011, 17:36:53

Previous topic - Next topic

Estraven

Hi,

I just ended up with a OutOfMemory issus while loading several files (wavs).

I tracked down the memory leak to the call of AL10.alBufferData(...)

When I comment this method call the memory of my system is stable. (but I've no more sound obviously...)
Otherwise, il litterally take 15MB out of JVM memory for each sound (about 10s wav), that never seems to be released.

I tried calling   AL10.alDeleteBuffers(buffer_al_id);
I also checked that my buffer is direct.
Now, I'm out of ideas... Anyone knows this problem ?

Thanks
Estraven

Estraven

Oups, problem solved... My bad. (alway is the programmer fault... I should know that...)

OpenAL has nothing to do with it. It just requires memory when loading a file, and as it's outside the JVM, the garbage collector does not activate.

That's not usually a problem, but my software has a memory leaks somewhere...
If i manually call System.gc() before loading wavs, I've got no more OutOfMemory problem...

Like i said... my bad. I'm gonna track down the REAL memory leak in my own source code.

Sorry.

CodeBunny


Estraven

Yes I do. My use of OpenGL has been tested from every angles, it's clearly ok. I was messing up redeclaring some byte arrays during FFT analysis of live audio streams. Nothing very serious.

YET ! now that my memory leak is fixed i end up having problems again  with alBufferData.

If I comment the call to this function, the memory usage is a flat line.
When I uncomment it back, I eventually end up with an OutOfMemory exception, with a very fast increase of memory usage on each wav loading....
So the problem persists !

Meanwhile, I switched to javax classes to read audio files, but i would prefer using OpenAL (because I'm trying to use audio-visual 3D rendering)

Estraven.