Ignacio Villaverde
Ignacio Villaverde

Reputation: 1264

Memory leak using Highcharts + AngularJS

I am using highcharts inside my AngularJS app, combined with highcharts-ng directive, and there is a memory leak which I cannot remove. My app consists of a slideshow, where there are slides that swap after a certain amount of time. These slides, include charts.

For making some tests, I have built 3 different snippets:

1 - A simple javascript app that rebuilds a chart every second. This does not produce a memory leak: http://jsfiddle.net/78af7zcm/

2 - An AngularJS app that manages an array of charts. Every second it removes one chart and includes another one, simulating a slideshow behaviour. I couldn't detect a memory leak here: http://plnkr.co/edit/7Zkheiz82ajVusB2EtqH?p=preview

3 - An AngularJS app, similar to number 2, but managing an active chart, which is being modified by listening to an event. The event is listened because in my original app I must do it like this, and here is where the memory leak appears. http://plnkr.co/edit/7cvDrMlWlgLOBAwoNgkW?p=preview . After 1 hour of execution and taking snapshots, I could see this:

After 1 hour of execution and taking snapshots, I could see this:

Could someone tell me why is this happening?

Upvotes: 0

Views: 441

Answers (1)

Ignacio Villaverde
Ignacio Villaverde

Reputation: 1264

I have solved my problem taking out the highcharts-ng directive and just using native Highcharts. Anyway, I could not understand why it was generating a memory leak but I have already posted it in their site.

Upvotes: 1

Related Questions