GithubHelp home page GithubHelp logo

Possible memory leak about yasha HOT 9 CLOSED

widepeepoclap avatar widepeepoclap commented on July 21, 2024
Possible memory leak

from yasha.

Comments (9)

davidzeng0 avatar davidzeng0 commented on July 21, 2024

This is a problem with FFmpeg, not a problem with my code. If you are calling destroy player, then all resources are freed. What's happening here is FFmpeg's very memory allocation heavy code and that the operating system isn't reclaiming the memory due to laziness.

Edit: grammar

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

I've done tests where I've launched several thousand players, killed them, and relaunched them, and the memory stays high but doesn't get higher, and after 10 minutes the memory usage stops growing.

from yasha.

widepeepoclap avatar widepeepoclap commented on July 21, 2024

Is there any workaround? Does using a different malloc help in this case?

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

I don't know if you can configure FFmpeg's malloc, I haven't gone through their source code that much, but the issue seems to be their libavformat library.

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

There are other forums that mention this "leak" and named possible causes like heap fragmentation, but I haven't bothered too much investigating.

from yasha.

widepeepoclap avatar widepeepoclap commented on July 21, 2024

I'd love to help with this but I don't have any experience with cpp yet.
A cron restart wouldn't hurt anyways. Thanks for the help.

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

I have a newer project coming out in about 1-2 months to replace this library and it doesn't have this issue. Can't give any promises on actual release date. Also uses 92% less cpu and 115KiB of memory per player on average. That's all I can promise as of now. Also, if you have more memory than it uses RSS, I think you'll be fine even without restarts.

from yasha.

widepeepoclap avatar widepeepoclap commented on July 21, 2024

Sounds really promising! Too good to be true actually 😅 since you've already did an amazing job on this and sange. Will be looking forward to try it though!

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

Hey, don't know if you're going to see this but the project has taken significantly longer than I anticipated.
I felt like I should inform you on the progress I've made since:
I think I might have some kind of prototype soon (<1 month away). I've already released most of the code that I've written so far in

xe
xetrov

and so far it covers all the basic needs of the final project

Though I am somewhat concerned about the safety of the code as I have not had time to check all my code logic.
If everything goes well, I should have something good before the end of the year :)

from yasha.

Related Issues (5)

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.