Thanks Jonathan, 

Could you give me some possibilities that could cause the leak? It's showing up 
in the profiler as a LineSeriesItem class leak. 


I tried reseting the LineSeries before each new plot using: 

for each (var lineSeries:LineSeries in chart.series)
    lineSeries.dataProvider = null;  
                                
// remove all lineseries
var tmp:Array = chart.series;
var len:int = chart.series.length;
for (var ss:int=len-1; ss >=0; ss--) {
    tmp.splice(ss,1);
}
chart.series=tmp;

but that had no effect on the leak. Not sure what else could be attached to 
LineSeriesItem that could still cause this leak. 

Any hints that could get me thinking where else to look for the source of the 
leak?  


----- Original Message ----- 
From: "Jonathan Campos" <[email protected]> 
To: "users" <[email protected]> 
Sent: Thursday, April 18, 2013 12:18:02 PM 
Subject: Re: how to dynamically add multiple LineSeries to a chart? 

On Thu, Apr 18, 2013 at 12:30 PM, <[email protected]> wrote: 

> I implemented your architecture below (using s.dataProvider instead of 
> s.dataField) and adding some code before and after it as follows: 


Well technically you can set the data on the chart and have the lineseries 
just represent a specific property on the chart's data. But whichever way 
works for your application. 

The memory leak could be caused by many many reasons. Ultimately something 
isn't being released as expected. You'll have to dig further into your code 
if you are duplicating your data or some other issue that may be causing 
the leak. 

-- 
Jonathan Campos 

Reply via email to