[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
www.dhtmlgoodies.com • View topic - How memory works for HTML DIV tag content ?
Page 1 of 1

How memory works for HTML DIV tag content ?

PostPosted: Fri Dec 08, 2006 8:40 am
by qwerty_zxcv
Hello;

I want to use a DIV tag for some search results containing images.
For each search request, I use this DIV tag. This search results could be retrived using AJAX for many times on the same DIV tag.

In this case , how memory works. :?:
For each DIV content refresh memory will be cleared ? or some times later will I get memory leak on my system?

Anyone has opinion on this scenario?

Thanks..[/quote]

PostPosted: Fri Dec 08, 2006 10:16 am
by Batalf
Hi qwerty_zxcv,

welcome to the forum :D

Updating a div several times won't cause any memory leak. Each browser has their own way of handling memory cleanup.

I'm not aware of any memory problems at all in Firefox.

However, there is a "well known" memory problem in IE caused by circular references. A circular reference happens when

1. Your javascript code has a reference to a DOM element(example a tag)
2. The DOM element got a reference back to your javascript code.

This typically happens in event handlers. When this happens in IE, the memory won't be released until the browser is completely closed. And you if you do a page refresh, the script will use more and more of your available memory.

You will find a lot more on this topic by making a google search on the words

ie memory leak javascript

But generally, updating a div several times shouldn't cause any memory problems. If you experience these kinds of problems, it's not caused by that, but by some other problems in the code.

PostPosted: Fri Dec 08, 2006 10:21 am
by qwerty_zxcv