-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible memory leak in api .load() when calling multiple times with interval or timeout #429
Comments
@rshingleton thanks for reporting. There's already a similar issue #347. If you read the comments, I made an example for the test, but I couldn't find any weird behavior at that time. I'll try to reproduce based on your example. If you find anything related let me know or plz leave some comments. |
I think the issue may be stemming from the generateWait() method in billboard.js/src/internals/ChartInternal.js. I believe the current implementation is creating a lot of timers and not clearing them properly. In fact, I think it just keeps creating timers because the function is broken. In all the tests I've run, this test:
Always seems to fail. The done variable always seems to be equal to 6 when using a timeseries graph and loading data whereas the transitionsToWait.length is equal to (120 * number of series) + 8 being loaded. I've switched from a timer based recursion to a promise and was running tests and so far it seems to be better, I need to let it run longer to be sure, but so far this looks better. I'm just not sure why the number of done is always 6 as yet, I certainly haven't dug that far into the code. I'm hesitant about the while loop, here, but I'm sure some better handling can be implemented. This is a quick test.
New test page structure
|
I monitored for hours based on your example, and the Anyway, I'll try look on |
@rshingleton, I did some refactoring to avoid unnecessary transition wait. Could you make a test with the latest build? And plz let me know how it was. If there's no necessity on using |
This seems to be doing much better, I need to run some additional tests against it. |
@netil, Why is this issue still open? |
@TheWitness, is because was waiting the confirmation after the test.
I guess is okay to close now, where the issue not been active for long time. |
Just seemed a long time. We just swapped over from c3 and I was fighting a memory leak and noted the age of the ticket without an update. |
@TheWitness, if you find any issue, plz open new issue. |
I have a vue application built on a model where I have a websocket connection that received periodic updates from several monitoring servers. When app gets an update, I do a call to chart.load(chartData) where the chartData contain is a populated object {xs: {},columns: [],colors: {}}. I noticed after migrating from another graphing package to Billboard that if I leave my page open that it will die after a very short interval, like within an hour.
In order to eliminate all other potential memory leaks, I created a simple page where I poll a single json endpoint and get an array of data with approximately 120 elements with a timestamp and datapoint. I then load this into a timeseries chart. I set a refresh interval with setTimeout at 20 seconds. After about 120 seconds the heap and listeners begin rising.
NOTE: There is also an open issue for c3.js for what appears to be the same thing:
https://github.com/c3js/c3/issues/1961
Chrome profiler with loading:

Chrome profiler without loading:

Sample Code:
Sample Data:
The text was updated successfully, but these errors were encountered: