Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-22144

Memory leak from SWFLoader, when loaded content absolutely in AIR

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.2 (Release)
    • None
    • mx: SWFLoader
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows XP
      Browser: Other (specify version)
      Language Found: English

    Description

      Steps to reproduce:
      1. Start an interval on 2 seconds in an AIR application;
      2. In interval's function create a SWFLoader instance, set it an absolute!! source path to a SWF, ( about 1MB size ), listen for load complete:

      l = new SWFLoader();
      addChild(l);

      l.load('http://localhost:8080/HtmlViewer.swf');
      l.addEventListener(Event.COMPLETE, zzzzz);

      The loaded SWF file is a flex web application in my case, containing only an empty text area, nothing else. For any flash movie it will work the same way, independently on whether it is created with flash or flex.

      The source path may point either a file from a local drive, or an HTTP resource.
      With a source like:

      c:/flash/sample.swf

      the problem will persist also, as for localhost files by http.

      3. On loadComplete try to unload the movie this way

      private function zzzzz(ev:Event):void
      {
      trace('unloaded');
      removeChild(ev.target as SWFLoader);
      (ev.target as SWFLoader).unloadAndStop();
      l.source = null;
      l = null;

      try

      { new LocalConnection().connect('foo'); new LocalConnection().connect('foo'); }

      catch (e:*) {}

      System.gc();

      }

      LoadComplete in our case happens for less than 2 seconds, so my destruction code surely executes before creation of a new SWFLoader to be required.

      Actual Results:
      Memory, observed for adl process in Task Manager permanently increases. No result of our trying to release the loaded SWF's memory.
      Count of instances of the loaded application also does not decrease - every 2 seconds it increases by 1. Memory graphics goes up without sloping down on garbage collection called.

      Expected Results:
      When I call unloadAndStop(), remove all references to the SWFLoader, call the LocalConnection hack for garbage collection or System.gc() method, I expect the memory that has been used for the loaded flash, to be released. I expect to see the result in instances count for loaded application in profiler, as well as in Windows's Task manager: the total memory of the application to decrease after removal with my function, not only to incraese on a new SWFLoader.

      I attach the file, that I load with SWFLoader, as well as its source.

      Workaround (if any):

      No workaround known - memory is still leaking.

      No browser, only AIR 1.5

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: