That looks ok. Now look at the moduleFactory for the module.
Thanks for responding Alex. You're always on top of this stuff. Here are the object references to the module factory:
So, if I understand correctly, it's saying that TheSansExtraPlainLightregular has a dictionary inside it that is referencing the module factory? And, if so, why is that the case and how do I avoid it?
Another thing of note is that the "instances" and "cumulative instances" of the module factory never decrease; they continue accumulating.
1 person found this helpful
Cumulative doesn't matter. It is only showing you how many ever got created
just in case it is an unexpected number. What matters is the number of
instances in any memory snapshot.
Is it increasing or staying at 1?
The dictionary references are weak keys so they aren't a factor. The
loaderInfo is a bit suspicious. I'd look at its call stack to see why it is
But if you are stuck at 1 instance, then I'd be looking at styles brought in
by the module. And resources too.
Sorry, I mis-spoke when I said "cumulative instances" in my original comment. I updated it to say that neither the cumulative (obviously) and the current instances decrease. For the module factory, these numbers continually increase and never decrease. However the first instance of the module itself and the popup that contains it are pinned in memory while the instances that follow are cleaned up.
Other than disecting each style I'm using in the module, how do I determine if styles are the source of my memory leak?
I'll dig into the loaderInfo some more too.
Thanks for the follow-up.
If current instances of the moduleFactory keeps going up, then I'm not sure
how you can say that only the first instance is pinned. That normally
indicates that all instances are pinned.
If you generate a link-report of the module, you can see what Styles it will
install (assuming Flex 3x). You can compare to the set of styles in the
main app. Any style in the module not in the main app will cause a leak, but
only for the first instance.
We're talking about three different things:
(1) module factory: continues going up
(2) module: first one pinned
(3) popup: first one pinned
To debug some previous memory leaks I had commented out as many components as possible to get down to a slim-and-trim module that would be easy to profile. I was then going to fix memory leaks as I uncommented each component. That helped me solve quite a few problems until I got to the first-instance-pinned issues. After a few cusswords and not seeing anything helpful in the profiler I uncommented everything on a whim and, who would've thought, no more memory leaks. I still don't know what was causing them but it's looking good now and it's not worth my time to figure out what was truly the source of the problem.
I did generate a link-report previously and didn't see anything suspicious regarding styles, but I didn't really know what I was looking for at the time. With your description, hopefully I can be more productive in the future. Thanks.