beetbox / pyacoustid

Python bindings for Chromaprint acoustic fingerprinting and the Acoustid Web service
MIT License
325 stars 66 forks source link

Memory leak ? #45

Closed fpom closed 5 years ago

fpom commented 5 years ago

I'm using acoustid.fingerprint_file() repeatedly on a collection of MP3 files, and I see the memory usage of my script growing over and over despite the fact I store the obtained fingerprints in a DBM. (I've done the same with SHA512 hashes and I observed no such increasing memory usage).

So I strongly suspect a memory leak in the library.

I've installed 1.1.5 with pip, using Python 3.6.2 under Linux.

sampsyo commented 5 years ago

Hi! Any chance you’re using GStreamer? If so, we may have just fixed the problem in audioread: https://github.com/beetbox/audioread/pull/84

fpom commented 5 years ago

I have no idea whether I'm using GStreamer or not. How can I check? I just do: import acoustid then acoustid.fingerprint_file(somepath).

BTW, I've replaced acoustid.fingerprint_file() with subprocess.check_output(["fpcalc", ...]) and it's much faster, which surprised me.

sampsyo commented 5 years ago

It's actually pretty hard to tell—you can check whether you have GStreamer and the appropriate Python bindings installed, and then it's likely that's what's happening.

fpom commented 5 years ago

I'm not sure but I think is is installed: the following does not fail

import gsi
gsi.require_version('Gst', '1.0') 
from gi.repository import Gst

So, since beetbox/audioread#84 has been fixed, my understanding is that the memory leak I've observed will be fixed in the next release?

sampsyo commented 5 years ago

Yep!

fpom commented 5 years ago

Nice ! :) Thanks for your help.