Author Topic: et tu JavaScript?  (Read 1151 times)

worker201

  • Global Moderator
  • Member
  • ***
  • Posts: 2,810
  • Kudos: 703
    • http://www.triple-bypass.net
et tu JavaScript?
« on: 24 November 2008, 11:09 »
I'm currently learning the Google Maps API for a school project, using a wonderful book called "Beginning Google Maps Applications with PHP and Ajax", by Purvis, Sambells & Turner.  When prefacing their discussion of best practices using the GUnload() function, they write:

Quote
One more important thing to do with your map is to be sure to correctly unload it.  The extremely dynamic nature of JavaScript's variables means that correctly reclaiming memory (called garbage collection) can be a tricky process.  As a result, some browsers do it better than others.

Firefox and Safari both seem to struggle with this, but the worst culprit is Internet Explorer.  Even up to version 6, simply closing a web page is not enough to free all the memory associated with its JavaScript objects.  An extended period of surfing JavaScript-heavy sites such as Google Maps could slowly consume all system memory until Internet Explorer is manually closed and restarted.

Naturally, I have no way to verify this, but that seems like reason enough to avoid IE at all costs.  As a side note, most sites using the Google Maps API do not use the GUnload() function.  Matter of fact, most "JavaScript-heavy" sites don't unload at all.

Lead Head

  • Global Moderator
  • Member
  • ***
  • Posts: 1,508
  • Kudos: 534
Re: et tu JavaScript?
« Reply #1 on: 25 November 2008, 01:19 »
What does it mean by simply closing a web page is not enough to unload all the saved Javascript information? I thought with IE6, every Page/Window was its own executable?
sig.

worker201

  • Global Moderator
  • Member
  • ***
  • Posts: 2,810
  • Kudos: 703
    • http://www.triple-bypass.net
Re: et tu JavaScript?
« Reply #2 on: 25 November 2008, 01:37 »
I guess they mean that navigating away from a page doesn't clear the memory.  Obviously, if you close a physical window, it's going to unload everything.  Er, at least it seems obvious to me - this is Microsoft we're talking about.