This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When is the memory occupied by elements in javascript released

 
ravisha andar
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I java the garbage collector frees the memory occupied by the variables of type String etc...................

How does the memory occupied by elements get cleared in javascript other than when the browser is closed.

For example

var a = document.getElementById('div');
When is the memory occupied by variable 'a' released.


And if we do

removechild(a);

What happens to the memory occupied by 'a' ?

Please help me understand this

Thanks

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript employ garbage collection just like Java. So objects are eligible for garbage collection as soon as there are no more reference to them.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic