javascript memory leak with requre js and js anonymous functions -


after executing below lines of code, user object not being collected gc. showing on chrome heap snapshot.

can help?

 define("mockmodule", [], function () {  function user(name) {     var = this;     this.name = name;     this.column = [{ id: 'xyz' }];     this.createobj(); } user.prototype.createobj = function () {     var = this;     this.column[0]['formatter'] = outerfunction(that); };  user.prototype.dummymethod = function () {  } ;  function outerfunction(that) {     return function () {         return that.dummymethod(that)     };   }  return { user: user }; });      define("mockmoduleimpl", ["mockmodule"], function (mockmodule) {  function init() {     var user = new mockmodule.user("hello");     user = null;  }  return { init: init };  });    require(["mockmoduleimpl"], function (mockmoduleimpl) {       mockmoduleimpl.init(); }); 


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -