[
https://issues.apache.org/jira/browse/FLEX-34194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13966379#comment-13966379
]
Lyndon Fasanya commented on FLEX-34194:
---------------------------------------
Hi Alex,
Your assistance on this is greatly appreciated.
Have got your stripped out version of 9-Apr, and repeated the steps above.
For me the module does not unload. There is a notable drop in memory usage but
the key indicator for me is the swf files size in scout that you can see in the
Summary Window. I compare the initial swf size before the module is loaded to
the swf size after I attempt to unload the module. The ActionScript objects
drop sharply however (which may have conveyed to you that the module has
unloaded) but not the swf file metric, incidentally what are you using to
confirm module unloading?
I am using non debug version of app and module.
In Scout, the shell Application swf size is 4067Kb without module rising to
4142Kb with module, on performing the steps above swf size remains at 4142Kb.
If you omit setting the dataProvider and then clearing it from the 5 Steps you
took, swf size returns to 4067Kb on completion of the steps.
It's this return to original swf size that I'm taking to signify that the
module has unloaded.
Are you using another indicator and are you using Scout?
> In Apache Flex 4.10 and 4.12 why does setting a dataProvider on a spark
> datagrid prevent the module it resides in from unloading from it's AIR
> application shell.
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: FLEX-34194
> URL: https://issues.apache.org/jira/browse/FLEX-34194
> Project: Apache Flex
> Issue Type: Bug
> Components: Spark: DataGrid
> Affects Versions: Apache Flex 4.10.0, Apache Flex 4.12.0
> Environment: Windows 7, IntelliJ12, Flex 4.12 SDK, Adobe AIR 3.8
> Reporter: Lyndon Fasanya
> Assignee: Alex Harui
> Priority: Blocker
> Attachments: ModuleUnloading.zip, MyApp.mxml, experimental.zip
>
>
> I have patched a module unloading shell app from the internet converting it
> to an AIR (3.8) application shell, to replicate the issue that I'm finding in
> our Enterprise Asset Management appplication, which needs this fix!
> I am using Adobe Scout to profile the application.
> In my shell application I load a module using module loader into a child
> Application Domain.
> The shell derived from Tom Sugden's module unloading application loads the
> module and like I have found online the first instance is pinned in memory. I
> thought possibly adding ArrayCollection and ArrayList in the shell app. would
> allow it to be removed but it doesn't I understand that this could be due to
> somehow this 'setting of the dataProvider' causing the module to be
> registered with the main app. I have looked in Scout and found the frame
> where the dataProvider is set and still I cannot identify from the AS objects
> or the function calls what could be doing it. Possibly it's a case of not
> knowing what to look for.
> Some other things of note:
> If I use an mx:DataGrid with same dataProvider the module unloads first time.
> If I use a s:DataGrid with no dataProvider set the module unloads first time.
> Even if I set a dataProvider on an s:DataGrid by pressing a button on the UI
> which caused the dataGrid to appear and then unset the dataprovider by
> setting the grids dataprovider to null the module does not unload.
> I have a project created that one can use to debug this attached.
> I would really like a solution for this and to be able to understand why this
> is happening in detail.
> I have keep-all-type-selectors set to true in the main app even if I remove
> all custom styles the problem remains.
> I upgraded from 4.10 to 4.12. This did not fix the problem.
> I even generated a link-report from the main app and used load-externs in the
> module to optimise any shared code defintions without success.
> I think this bug is critical and understandably I do not want to use an
> mx:DataGrid.
> Given :
> I have the Adobe Scout profiler running and,
> I load a module containing a populated spark dataGrid with test objects such
> as
> new ArrayList([{'a':'a1','b':'b1'},{'a':'a2','b':'b2'},{'a':'a3','b':'b3'}]);
> And then I unload the module.
> Expected:
> Clicking Garbage Collection from scout or even from within the app, will
> remove the module from memory.
> Actual:
> Some garbage collection occurs as present in Scout, but the swf file
> representing the module is not garbage collected and still viewable in Scout.
--
This message was sent by Atlassian JIRA
(v6.2#6252)