Is it possible to delete some images from the browser (firefox2) memory using javascript? By doing this, I want to save some precious browser memory and let my web app to work better.
I guess that if possible, it will be something like this:
delete (document.images[7]);
document.images[7].src = null;
document.images[7] = null;
The most sensible thing would be to remove the Image element from the DOM.
I don’t know how much memory that is going to save you, if at all. The
deleteoperator wouldn’t do anything in this case because the HTMLCollection returned is ready-only.Is there a particular reason you need to free up memory? Perhaps there are some memory leaks? Maybe this would help: http://www.ibm.com/developerworks/web/library/wa-memleak/.