2 Replies Latest reply on May 2, 2012 7:16 PM by Reald__

    big trouble! every message to BlaseDS has a memory leak of string

    Reald__

      big trouble! every message to BlaseDS has a memory leak of string

       

      i'm confussing on this for month, need a handsome anyone help and with great thanks.

       

       

       

       

      trouble is this:

      1.i useed RemoteObject to call a function on java every 0.05 second, the memory will leave a string can't free per call, string like this: "6FC75E07-D8B6-785B-183F-0B93CE990", every id is Message id as i know, i saw them in profile analysis. whatever simple baseic function i wrote, it happened this wrong the same, even the helloworld function without a hello world print just a simple return.

       

       

      detail like this:

      1.on my test, i configed a java web project on tomcat6, and configed a BlaseDS in it.

      2.i set a function just name it as helloworld, and write just a return in java project;

      3.i set a simple RemoteObject object and a timer run it every 50ms.

      4.i run it on profile and saw the question.

       

       

       

       

       

      flash bulder code:

      <?xml version="1.0" encoding="utf-8"?>

      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

              xmlns:s="library://ns.adobe.com/flex/spark"

              xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="exe()">

      <fx:Script>

        <![CDATA[

         import mx.messaging.messages.RemotingMessage;

         import mx.rpc.events.FaultEvent;

         import mx.rpc.events.ResultEvent;

        

        

        

       

         private var serverRemoteDestination  :  String  = "facilitiesBiz";

         private var remoteObjectGetFacility  :  RemoteObject  =  new RemoteObject();

        

         public function exe():void{

          remoteObjectGetFacility.endpoint = "http://localhost:8080/NewM/messagebroker/amf";

          remoteObjectGetFacility.destination  =  serverRemoteDestination;

          var timer:Timer=new Timer(50);

          timer.start();

          timer.addEventListener(TimerEvent.TIMER,gogo);

          function gogo(e:TimerEvent):void{

           tabRemotor.getOperation("testing").send();

      //     remoteObjectGetFacility.getOperation("getFacilities").send("admin","admin");

          }

         

          if(!tabRemotor.hasEventListener(ResultEvent.RESULT)){

           tabRemotor.addEventListener(ResultEvent.RESULT, remoteResultFunc);

           tabRemotor.addEventListener(FaultEvent.FAULT, remoteFault);

          }

         

          function remoteResultFunc(e  :  ResultEvent)  :  void

          {

           //    remoteObjectGetFacility.removeEventListener(ResultEvent.RESULT, remoteResultFunc);

           //    remoteObjectGetFacility.removeEventListener(FaultEvent.FAULT, remoteFault);

           //    remoteObjectGetFacility.getOperation("getFacilities").clearResult();

           //    remoteObjectGetFacility.getOperation("getFacilities").cancel();

           //    remoteObjectGetFacility.channelSet.logout();

           //    remoteObjectGetFacility.disconnect();

      //     trace("one processed");

           //    remoteObjectGetFacility.logout();

          }

          function remoteFault(e  :  FaultEvent)  :  void

          {

           //    remoteObjectGetFacility.removeEventListener(ResultEvent.RESULT, remoteResultFunc);

           //    remoteObjectGetFacility.removeEventListener(FaultEvent.FAULT, remoteFault);

           //    remoteObjectGetFacility.getOperation("getFacilities").clearResult();

           //    remoteObjectGetFacility.getOperation("getFacilities").cancel();

           //    remoteObjectGetFacility.channelSet.logout();

           //    remoteObjectGetFacility.disconnect();

           //    remoteObjectGetFacility.logout();

           trace("error");

          }

         }

        ]]>

      </fx:Script>

      <fx:Declarations>

        <!-- 将非可视元素(例如服务、值对象)放在此处 -->

        <s:RemoteObject endpoint="http://localhost:8080/NewM/messagebroker/amf" destination="facilitiesBiz" id="tabRemotor">

         <s:method name="testing"/>

        </s:RemoteObject>

      </fx:Declarations>

      </s:WindowedApplication>