2 Replies Latest reply on Jan 4, 2011 5:41 AM by vince.sp

    Polling application and System.gc()

    vince.sp

      I discovered that a polling AIR application slowly uses more and more memory, probably because of the garbage collection algorithm.

       

      These two screen shots show the memory usage displayed in the Flex profiler of an application that polls XML data from a Web server every 3333 ms:

      nogc1.pngnogc2.png

      As you can see, the application slowly uses more and more memory, because the GC does not run until it needs more memory. Each time it hits the threshold, it reserves additional memory for one RPC run and then collects the memory.

       

      This is the same application, but it has an callLater(System.gc) in the result event of the HTTPService. Memory usage stays flat:

      withgc.png

      Is there another solution to this behaviour than calling System.gc()?