I can tell you after talking with one of the Chart QA team, they know of a memory leak involving resetting the dataprovider of a chart. I had a chart that would refresh every 30 seconds (httpservice connected to an arraycollection for the chart’s dp) that in 4-5 hours would take 95% of your computer’s CPU usage. This is probably something very similar.

_________________________________________

Jonathan Miranda

Flexible Master of the Web

"In the game of chess, it's important to never let your opponent see your pieces."

HealthGrades: Guiding America to Better Healthcare™

NASDAQ: HGRD

w  (720) 963-3832

c  (707) 761-0868

[EMAIL PROTECTED]

_________________________________________

The message contains confidential and/or legally privileged information and is intended for use only by the indicated addressee.  If you are not the named addressee you should not disseminate, distribute, or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmissions cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed,arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of thunderstumpgesatwork
Sent: Tuesday, February 28, 2006 2:34 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] repost - Memory leak repeatedly assigning new series to a chart. (2.0b1)

 

Hello,

I'm reposting this because I got no responses last time and I was
hoping one of the Flex engineers could confirm that it has been noted
(if not verified) that this is happening.

This represents a major blocking point to releasing our app. Memory
usage CAN NOT continue to grow unbounded.

I've narrowed it down to code which cleans up a chart's
series array and re-initializes it to add a new set of series with new
dataproviders, etc.

Note that with only the AddSeries, and SeriesDelete functions removed
(all other code including CategoryAxis create/delete, and all XML
manipulation remained) there was no leak.

I posted a "best practices" question about list cleanup and memory use
which describes the architecture I have:
http://groups.yahoo.com/group/flexcoders/message/29638?threaded=1

Below is the implementation of DeleteSeries which attempts to remove
every series in the chart and clean up the dataProvider in it.

Can someone who knows the internal workings of the charts maybe look
at this and see if I'm missing something or if there are any known
issues with the cleanup of chart series?

thanks,
Thunder
__________________________________

public static function SeriesDelete( thisChart:ChartBase )
{
    // try to clean up the series
    var i:Number = thisChart.series.length;
    while(i--)
    {
        var obj:Array = thisChart.series.splice(i, 1);
        var oSeries:Series = null;
        if (obj[0] is Series)
        {
           oSeries = Series(obj[0]);
          if (oSeries.dataProvider is ListCollectionView)
          {
             var oView:ListCollectionView =
ListCollectionView(oSeries.dataProvider);
             oView.removeAll();
             if (oView.list != null)
                oView.list.removeAll();
             oView.release();
             delete oView.list;
             oView=null;
          }
          delete oSeries.dataProvider;
          oSeries.dataProvider=null;
          delete oSeries;
          oSeries=null;
       }
       obj=null;
    }
    thisChart.series = new Array();
}







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to