-
Notifications
You must be signed in to change notification settings - Fork 176
Description
Hi,
We are using this component at version 3.0.1 on our application with angular 8 and I have been investigating a memory leak narrowing it down to this component. Let me give some context on how we use this component.
-
We have an always-visible part with the round progress and use it to show the progress of the current operation taking place.
-
Those operations can range from minutes to hours.
-
We set a timer (using setInterval and clearInterval at the end, also tried with rxjs timer) of that every 1 second updates that current progress that is fed to this component.
-
Component is configured as follows:
<round-progress class="c-round-progress__circle" [current]="current" [max]="max" [color]="color" [stroke]="stroke" [background]="background" [radius]="40" [semicircle]="false" [rounded]="false" [clockwise]="true" [responsive]="true" [duration]="1000" [animation]="'easeInOutQuart'" [animationDelay]="0"></round-progress>
Stroke is 1, Max and Current change depending on the operation, and I don't think colors are relevant to the problem.
So, with the UI on idle state from a user perspective but the round-progress being updated, I could see memory increasing (even considering garbage collection after some time). Reproducing the same scenario but removing your component from the screen makes memory stable.
I tried also with the demo application in latest version (6.0.1) and after toying around for some time I could see that memory went up (checking chrome task manager). Even in one case on the demo app I found memory going crazy up without me bothering it anymore, to later be cut down by the GC (I assume; this rare situation could be just Chrome though).
I have briefly looked at your code but I have not seen a clear reason behind it, though I'm no JS/TS expert.
Could it be a configuration problem? It is a problem to have matching duration and timer updates? What happens if animation hasn't finished and a new change occurs?