worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

out of memory when use mysql #276

Open haha010508 opened 2 years ago

haha010508 commented 2 years ago

I installed the mysql server in my Docker image and recorded about 200 songs. After many queries, the mysql server crashed due to out of memory. Has anyone encountered this problem? Is there a problem with mysql server or mysql-connector-python?

haha010508 commented 2 years ago

Now, I'm sure mysql-connector-Python is causing a memory leak. If I keep running recognize_files (there are multiple audio files), the Memory of Python processes keeps getting higher and higher until out of memory, can someone to fix this problem? Or do I need a different database?

busterbeam commented 2 years ago

Two simple questions. Why do you need to use a database? Also why do need to use a docker image?

I've stated before look into the fingerprint.py script, in fact the script is a bit rubbish to encoding, instead of using the hash as a integer it uses string which will use a lot more memory in a database (or whatever structure you may use).

haha010508 commented 2 years ago

This is my fault, i open plot and forget to close, so everytime 10M memery is lost.