My application uses a tab management which will have forms being customized
for each tabs for the selected item. so far each tab a new DOM will
constructed using the $compile attached the code for the same
var cachedFomObj = $templateCache.get(name+"_"+FA);
if(angular.isUndefined(cachedFomObj)){
var serviceObj = this;
serviceObj.get(templateURL).success(
function(data, status, headers, config) {
var templateHTML = data;
serviceObj.get(configUrl).success(
function(data, status, headers, config) {
if(childScope != null){
childScope.$destroy();
}
//Create a new scope that inherits from our current scope
childScope = scope.$new();
var configObj = data.fields;
cachedFomObj = serviceObj.getFormObj(configObj, templateHTML, name);
$templateCache.put(name+"_"+FA, cachedFomObj);
$templateCache.put(name+"_"+FA+"_configobject", configObj);
node.empty().append(cachedFomObj);
cachedFomObj.on('$destroy', function() {
console.debug("destroying child scope");
if (childScope != null) {
childScope.$destroy();
childScope = null;
}
});
$compile(cachedFomObj)(childScope);
}).error(function(data, status, headers, config) {
console.debug("Error occurred while fetching template");
});
}).error(function(data, status, headers, config) {
console.debug("Error occurred while fetching template");
});
the main problem is the $compile which internally occupies memory(around 20
to 30 MB) on each call and not getting released, I wanted to know how to
handle this memory leak, referring some forums I implemented childscope but
still I see the same problem, so if I continuously use the system switching
around the tabs within my application it occupies 1GB of memory in the
browser, looking for a solution inregard to this. Thanks in advance
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.