Continous increase in Memory usage

This will solve the problem in simple cases, but I can’t say for sure whether this will work in your case without reading it carefully.

import gc
del arr, audio_data
gc.collect()