Using the Adobe Flex App Page File Through the Roof!

I've been working on an Adobe Flex app for several months now and the app is rated 24/7 for days (weeks!). However, I can now see that after a few days of running nonstop, the computer it starts on is telling me the system is inactive in virtual memory and giving me an error regarding page file usage. When I close the Flex application, the page file usage decreases from 1.9 MB to 100 MB (or less). It seems to use all this memory and does not free it, although I am very careful in my application not to store huge arrays.

The app does some graphics and draws a lot of shapes (to savor the "gauge") and then disposes of them by re-declaring that object as another "gauge".

Any idea why my pagefile usage goes up so high ?!

+2


source to share


3 answers


You probably have eventListeners that are not being removed. They preserve references to objects and prevent them from being garbage collected.



+2


source


You can use the profiler in Flex Builder Professional to see where your memory usage goes. Like the other posters mentioned, event listeners are the culprit many times, but in general, just because you think you are disposing of (destroying or deleting) a variable doesn't mean that it really cares about the garbage collector. If any reference (such as an event listener) still exists for this variable (or object), it will not be collected. The profiler will point out these things.



+2


source


I've heard rumors that something on stage will create memory leaks. In other words, you can be as careful as possible with your code, but you will still leak memory. To my knowledge, this has not been confirmed by Adobe. A good test would be to instantiate the Shape and Sprite and MovieClip, add them to the display list, and then launch the application overnight. Would love to hear the results if you finish testing.

0


source







All Articles