Check that you have initialized the array with enough buffer.
You might want to debug, by blocking, portion-by-portion of your code to see which portion of the code contribute to the leak.
Also, you may need to add a small loop delay (ms) to free your CPU up.