I think I've found a pretty substantial memory leak in pydirac - a temporary array being alloc'd doesn't get Py_DECREF'd, which causes Python to hold onto the reference forever, essentially leaking the entire temporary buffer. (As pydirac is usually used on very large arrays... this leads to many-dozens-of-megabytes being lost every call.)
Memory usage without this patch:
...and with the patch:
Test program to generate the above Instruments graphs:
a = audio.LocalAudioFile('../wubmachine/tests/mario.mp3')
for _ in xrange(0, 1000):
dirac.timeScale(a[0:300000].data, 1.4, 44100, 0)
Fixed memory leak in dirac
Temporary view of `insound` wasn't being DECREF'd, so it hung around
and never got cleaned up by the Python GC.
Also fixed mem leak in crossfade due to not calling Py_DECREF on each…
… component of the fade.
Found a leak in echonest.action.Crossfade too:
Test case to reproduce the above graphs:
a = echonest.audio.LocalAudioFile('../wubmachine/tests/mario.mp3')
for _ in xrange(0, 100000):
echonest.action.Crossfade([a, a], [5, 10], 5).render()
Awesome peter! These would be mine... oops!