You will have a memory leak as soon as you return the result of calling $http() (or any other object or function that has access to hugeData ) to the outside of fetchResults .
With your code, nothing is displayed directly outside of fetchResults , and the result of calling $http() will live until it succeeds or fails, and then calls the corresponding callback, finally getting GC'ed.
See info: http://jibbering.com/faq/notes/closures/#clIdRes
As @ ŁukaszBachman notes, this does not guarantee that there are no memory leaks. Any freezing link to your large object or your callback with a large object in scope will cause grief.
So, consider the implementation of $q ( $http based on $q ).
If you check https://github.com/angular/angular.js/blob/master/src/ng/q.js#L191 , you will see that the deferred resolve() method first copies the list of registered callbacks to the local variable for the method:
var callbacks = pending;
subsequently invalidates the outer pending (which was defined at defer level)
pending = undefined;
then at the next tick, callbacks are executed. This can be complicated by the fact that the callback argument can be delayed (adding extra delay to the execution), but at best you can get into an infinite loop. (And this is not funny!). If you are lucky enough to get into a loop, then at some point the callback array is exhausted, and then there is no link to the callback list, so it is available for GC.
But.
Everything can go wrong if you force them.
You can use arguments.callee inside the callback.
You can also drink beer on the keyboard.
If you jump out of the window, if you do not live on the ground floor, you will probably be hurt.
Happy EcmaScripting!