3 Replies Latest reply on Sep 29, 2010 9:49 AM by Flex harUI

    Memory Leak while calling HTTPService


      Hi everybody,


      i am building Flex application and encounterd a problem.

      If i call the send Method of the HTTPService function sequently, the memory and size of the flash application is rising and rising.

      I watched it with the Flash Profiler and found out that the instances of DirectHTTPMessageResponder are rising and rising. The strange thing is, that in Flash Profiler the Garbage Collection triggers periodically and clean this instances. But if i call the application in debug or release mode, the size is rising and never fall back.



      Here is the example of my code:


                      mHttpService = new HTTPService();
                      mHttpService.url = mWebServiceUrl;
                      mHttpService.addEventListener("result", httpResult);
                      mHttpService.addEventListener("fault", httpFault);
                   if (mHttpService)
                       var request:Object = new Object();

                       request.text = 1;





      private function httpResult(e:ResultEvent):void
                      mHttpService.removeEventListener("result", httpResult);
                      mHttpService.removeEventListener("fault", httpFault);
                      mHttpService = null;

                 //Dispatch a Event
                  var f:IdManagerError = new IdManagerError("back", "now i am back from request");


      When the Event is dispatched i do a new request. So the request are done sequently(in average every second).


      Does anybody encounterd the same problem? And is there a solution for  this. Or do i something wrong?


      Please this is very urgent.


      Thanks in advance