I'm facing with a memory leak in my Flex application.
The Flex application is part of a big web application (with all kinds of technologies inside).
The memory leak occurs when the Flex app invokes a refresh polling from the server every 5 sec.
The facts are:
- I'm using AMFChannel to make the connection. Polling is false. Each refresh creates new AMFChannel instance.
- Server side is BlazeDS, running as a servlet inside my web application.
- The memory leak occurs on IE and FireFox. It not occurs at all on Chrome.
- Over one night the IE memory increase in hundreds of MBs and eventually is crashing.
- In the Flex, the memory do increase but much slower. Over night it
will increase in 30MB.
- Using the Flex profiler I saw that the increased memory is related to
the AMFChannels.
- I tried to set AMFChannel requestTimeout to 60 sec. It did nothing.
- I tried to set BlazeDS connect-timeout-seconds to 60 sec. Nothing changed. But I'm not sure I did it correctly.
My conclusions till now are:
- The AMFChannel is actually gets a connections from the browser. In Flex the AMFChannel consuming small piece of memory, while in the browser it consume much more. This explain the different in the memory consuming between the Flex app and the IE.
- Somehow, the AMFChannel is not shutdown and not garbage collected.
My requests:
- Is my conclusions are right?
- How to make sure the AMFChannel is shutdown and cleaned up?
- Is the connection instance on the client is controlled by the BlazeDS (on the server side)?
- Any other clue to help me continue investigating this issue
Thanks