2 Replies Latest reply: Aug 24, 2014 11:22 PM by Flex harUI RSS

    Memory Leak in BlazeDS

    Mohd Fayaz Community Member

      I have used BlazeDS in an  application to push the data in realtime. However, we have been  experiencing a heavy memory leak in the application. The application has  a scheduler that pushes the data every one minute into the default  queue. Without any browsers opened, the appication remain stable. And  closing the browsers also cleans up the FlexClient object and other  associated objects for that browsers. But the leak occurs when we open  and keep browsers for a long period, say 2 to 3 days. The memory usage  of application gradually increases and throws a  "java.lang.OutOfMemoryError: Java heap space" Exception. On analyzing  the HeapDump, I found that there are thousands of AsyncMessage Objects  in the memory, not getting garbage-collected. This the channel definiton  congured in services-config.xml file

       

       

              <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
                  <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                  <properties>
                      <polling-enabled>true</polling-enabled>
                      <polling-interval-seconds>4</polling-interval-seconds>
                      <invalidate-session-on-disconnect>true</invalidate-session-on-disconn ect>
                  </properties>
              </channel-definition>

      Does anyone know the cause of this issue and how it can be overcome. Please help.