Git Product home page Git Product logo

Comments (7)

catchanus avatar catchanus commented on July 28, 2024 2

It works perfectly.

from python-sounddevice.

mgeier avatar mgeier commented on July 28, 2024

Thanks for the report!

I can confirm that your script keeps growing its memory usage.
When I tried it, it started around 30 MB and reached 250 MB at the end of the script.

I have no clue why this happens ...

Did you try it with Python 3?

When I tried it with Python 3 (after replacing the print statements with print() function calls), the memory consumption grew in the beginning, but then it stayed slightly below 70 MB.
This is obviously better, but probably it should still be less ...

I don't know if there is anything I can do, any ideas?

from python-sounddevice.

mgeier avatar mgeier commented on July 28, 2024

@Plecto123 Any news on this?

from python-sounddevice.

venkat-kittu avatar venkat-kittu commented on July 28, 2024

Hey @Plecto123, how did you solved this problem. Now i am also facing same issue in my case memory is going upto 3.1 GB and program is getting stopped.

my os is Ubuntu 18.04
python is 2.7

from python-sounddevice.

mgeier avatar mgeier commented on July 28, 2024

There have been some improvements in the latest CFFI release 1.12: https://cffi.readthedocs.io/en/latest/whatsnew.html#v1-12.

The script on the top of this page now still has growing memory usage, but in total it only needed 84 MB with python2 and about the same with python3.

@Plecto123 and @venkat-kittu Does that improve your situation?

from python-sounddevice.

catchanus avatar catchanus commented on July 28, 2024

I suggest such a solution:

In the 'stop ()' function of 'sounddevice.py' (319th line) add two lines at the end of the 'if' statement:
_last_callback.data = None
_last_callback.out = None

This frees up the memory used by the 'numpy' object.

from python-sounddevice.

mgeier avatar mgeier commented on July 28, 2024

Thanks @catchanus for the hint, I've implemented it in #250.

Can you (and @Plecto123 and @venkat-kittu) please check if that works for you?

from python-sounddevice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.