Just a short example of the cause:

function Car(){
        this.type = 'Volkswagen Touraeq V12 Diesel' 
        // just love this car.. sorry..

      this.draw();
}
Car.prototype = {
      
      draw : function(){
         this.element = document.createElement('A');
      }
}

var simsalabim = new Car();


This creates a JavaScript object, respectively "Car". This is maintained
in the Javascript GC. 

Then in the draw method the element A is created, respectively a DOM
object. This is maintained in the browser GC.

Once you remove the object Car, the Javascript GC releases the Car
object from memory. But.... the A element in the browser GC is still
active/referenced. This part of the deal is never released unless you
set the reference to null.

Same happens in the other way, once you remove the element A from the
page with removeChild, the Car object still exists, and this.element
still holds a reference to that A element despite it does not exist.

Both GC's don't communicate with each other, they don't know about each
other either. 

That is what is causing memory management issues. Is this a bit clear?
:) You might understand this starts out simple, but increases in
complexity on larger complex applications. 


Micha Schopman
Project Manager

Modern Media, Databankweg 12 M, 3821 AL  Amersfoort
Tel 033-4535377, Fax 033-4535388
KvK Amersfoort 39081679, Rabo 39.48.05.380

------------------------------------------------------------------------
------------------------------------------------------------------------
-----
Modern Media, Making You Interact Smarter. Onze oplossingen verbeteren
de interactie met uw doelgroep. 
Wilt u meer omzet, lagere kosten of een beter service niveau? Voor meer
informatie zie www.modernmedia.nl 
------------------------------------------------------------------------
------------------------------------------------------------------------
-----



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197822
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to