Currently I'm into adding AngularJS to a site that cannot be fully converted in one shot but already has single page app functionality through jQuery/Ajax.
To get both worlds working together I've got a main controller that knows the current page controller and calls $destroy() on it when the ajax mechanism was triggered for page change. All the containing scopes get cleared up well as they should, the new html comes into the page and is then being compiled by that main controller to activate all the new angular stuff which works perfectly well, too.
The only problem there is, that on every page change, the whole DOM seems to stick in the memory and is not released into garbage collection, resulting in +20 to +35 MB of RAM consumption on each page navigation.
http://i.kw.cx/ip/6195134616104642286.png
As you can see on the image of the snapshot there is an tremendous amount of detached DOM elements that all seem to be connected to jQuery / the jQuery cache.
The problem seems similar to the one described here: How to catch memory leaks in an Angular application?
So I checked the usage of jQuery and AngularJS is using the loaded full version of jQuery, not the jqLite version, since I'm able to use all available plugins and methods on $element received in the controller - which I exposed to the window-object to observe that.
Thus, as the website and AngularJS are using the same jQuery version, there should be no problem with 2 disjunked internal caches each holding DOM references on their own and probably mixing things up. But I have to add that the page still is running on the quite old jQuery v1.7.1 since it cannot be updated at the moment.
As I've already removed everything except simple HTML and the Angular directives I'm really running out of ideas where to look next so any ideas, hints or clues are very welcome!
Thanks in advance, I'm already strugling with it for more than a day...