Code Monkey home page Code Monkey logo

Comments (2)

crisbeto avatar crisbeto commented on June 10, 2024

Honestly there isn't that much that could cause a memory leak in the component since it's basically taking the values of a bunch of inputs and generating an SVG out of them. The one place that is slightly risky is the animation based on requestAnimationFrame, but if that were leaking, you'd see a spike in CPU usage, rather than a memory leak (see https://github.com/crisbeto/angular-svg-round-progressbar/blob/master/src/lib/round-progress/round-progress.component.ts#L109). There is also some logic that should prevent overlapping animations.

One thing to try is to update to the latest, or at least a later, version of Angular which may contain a fix for your leak.

from angular-svg-round-progressbar.

Blackvals avatar Blackvals commented on June 10, 2024

Thanks for your quick response.
I agree with you, the only part on your code that brought me doubts was the requestAnimationFrame precisely for being a recursive call based on the duration. As for the CPU spike, I was not checking it because the main resource problem was memory related, but it could be.

Following that trail, I have tried reducing the duration to the minimum (1) and the memoy stays in check. In the end, if we are updating the progress every second for a operation in the range of minutes or hours, it is barely noticeable the fancy animation; so is a trade-off we can pay.

Unfortunately the Angular update is something not possible at the moment, but something we look forward for the near future.

from angular-svg-round-progressbar.

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.