3 Replies Latest reply on Mar 1, 2007 10:28 AM by beckerb4

    chart : assigning new series to a chart causes memory leak

    jim_phelps
      Hi,

      I'm encountering a major problem using chart with actionscript. Indeed, my chart is dynamically populated through a httpService which is refreshed every minute. After 4 hours, the process (which has began at 60 Mb) is 400 Mb.
      Looking for this kind of problem (and after having tried every tips about memory usage), I found some threads in different forums talking about this problem.

      Explicit Thread :
      thread repost - Memory leak repeatedly assigning new series to a chart. (2.0b1)

      This thread deals with a memory leak caused by the reset of the dataprovider and known by Chart QA Team (???).

      This problem is very important because it doesn' t allow all flex developers to manipulate the charting components in actionscript and/or in dynamic applications (~refresh)
      I would like to know if it's possible to have a confirmation of this fact and in this case, if there is a workaround or a planned correction ?


      Thanks,

      Olivier
        • 1. Re: chart : assigning new series to a chart causes memory leak
          pythonluv
          Hi,

          I have exact same problem as you do. I am currently evaluating this flex chart and this seriously discourage me to purchase the product.

          I thought the memory leak problem was coming from httpService for my case.

          I would love to know if you find the fix for this


          • 2. Re: chart : assigning new series to a chart causes memory leak
            beckerb4
            I have a similar problem.
            I am embedding flex charts that I generate by passing xml to AS3 in my html application. I noticed that the memory usage jumps by about 10meg everytime I switch to a new chart. Eventually IE run out of memory and crashes.
            Is the memory allocated by the browser for the plugin ever reclaimed?
            Any clues would be appreciated.
            • 3. Re: chart : assigning new series to a chart causes memory leak
              beckerb4 Level 1
              I am pretty confident I know what is causing the leak for us.
              If I comment these lines in our GeneratorComponent.as class

              // ExternalInterface.addCallback("generateFromXml", generateFromXml);
              // ExternalInterface.addCallback("isInitialized", isInitialized);

              Then the leak does not occur.
              If I leave them uncommented, then it does occur.

              Is there a way to remove a callback when after it has been added? I do not see a removeCallback method on ExternalInterface.
              Would addCallback("name", null) work? (actually, I tried it, and it did not appear to)
              If that (or some other trick) does work, then I need to remove the callback when the object goes out of scope and gets deleted.
              Is there a way to detect that?