I am using a thread which records the audio using AudioRecord class and placed in recorderBUffer (which is a linked list of Short[]) , a separate thread which does the encod
A temporaral solution of the problem was by increasing the HeapSize using dalvik.system.VMRuntime.getRuntime().setMinimumHeapSize(32 * 1024 * 1024);
However this approach is not recommended and should be avoided.
By Extensive debugging I found that the real problem was due to overlapped interfaces and some leaky functions. Later I removed one of the Interface, redesigned the overall solution and re-factored the code and that solved my problem.
Please share if you have some other Solution,