GithubHelp home page GithubHelp logo

Memory leaks about connxr HOT 4 OPEN

alrevuelta avatar alrevuelta commented on July 17, 2024
Memory leaks

from connxr.

Comments (4)

alrevuelta avatar alrevuelta commented on July 17, 2024

Yes, agree that we have some memory leaks. How did you find them? Unexpected crashes or were you using some tool like valgrind? Could you list the ones that you are aware of?

from connxr.

Coderitter-GmbH avatar Coderitter-GmbH commented on July 17, 2024

The hardware the library is running on has very limited ram (2 megabytes). It was running out of memory very quickly. For the detection of leaks i used the gcc address sanitizer. I have already some fixes but i wanted to discuss one more aspect. The memory used for an inference can be freed while the inference is running, to reduce the memory foot print. Only the results of prior node is needed to calculate the actual node.

from connxr.

alrevuelta avatar alrevuelta commented on July 17, 2024

Could you provide the commands you used for the gcc address sanitizer? In the future some kind of memory leak detection should be included in the GitHub Action CI.

Regarding freeing memory from past nodes, I agree that there are some optimisations that can be made, but note that its not that straight forward. A model like mnist is a set of nodes connected in series to each other, so freeing the memory from the previous node output will work just fine, but there are more complex models that contain "branches" and "Only the results of prior node is needed to calculate the actual node." won't be true.

So we would need some kind of algorithm that scans the model an decides which outputs can be freed, and which ones will be needed later on in a different node. Having a flag with this choice (free unused outputs vs keep them) would be a really nice future, but imho it needs a bit of thinking. Feel free to open a new issue with this feature request :)

from connxr.

Coderitter-GmbH avatar Coderitter-GmbH commented on July 17, 2024

You can compile the software with the additional gcc flag -fsanitize=address. This will enable the address sanitizer, which detect out-of-bounds and use-after-free bugs and memory leaks.

from connxr.

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.