The memory leak was caused by event listeners for PhoneApplicationService. I unwired them in CordovaBrowser_Unloaded (pull request: https://github.com/apache/cordova-wp8/pull/41). It fixes the leak but I want to make sure it doesn't go against the intended behavior.
On Tue, Jun 17, 2014 at 11:58 AM, Staci Cooper <staci....@gmail.com> wrote: > Hey, > > I'm looking into CB-6924 <https://issues.apache.org/jira/browse/CB-6924>, > where I'm seeing a memory leak in WP8 when navigating back and forth from a > native to a hybrid page. A new page is being created every time you > navigate to the Cordova page, and none of them are garbage collected. > > Is this the intended behavior? When a new page is constructed, a new > CordovaView is being created with it. The CordovaView has a bool called > 'IsBrowserInitialized' > <https://github.com/apache/cordova-wp8/blob/master/wp8/template/cordovalib/CordovaView.xaml.cs#L43>which, > according to the comment, "prevents data clearing during page transitions". > It is set to true in CordovaBrowser_Loaded, or causes the handler to return > if it is already set to true. I'm not sure if 'page transitions' refers to > transitions within the CordovaBrowser or at a higher level. >