photography by Kristel van Beek
posted by: martijn, at 9 November 2007 11:12 GMT+1, 7 January 2008 22:00 GMT+1
You should think this would help but the memory keeps pilling up no matter what. Thanks to Flex Builder 3 and the profiling feature I could locate the problem. The page objects that should unload where not unloaded. The pages I'm loading are populated with classes for loading images/videos/text. These objects all contained a reference to the page object. When I unloaded the page object the most logic situation would be that the Flash Player would do some garbage collection and cleaned out the memory but that wasn't happening because of the reference to the page object (which took me some days to figure out).
Adobe has a nice page about garbage collection here. The document has a chapter about "Mark sweeping" which explains the technique that should solve my problem but it doesn't.
The image should explain it better. In the first situation you see an abstract structure of a swf, the red line referers to the object reference I talked earlier about.
The second situation should be deleted with the "mark sweeping" method Adobe mentioned.
The third situation is the solution for my problem, the reference is deleted and the garbage collector finally frees the memory as it should.
wenzhi li says:
at 9 November, 2007 15:18 riameeting.cn