Re: PHP FREE MEMORY
| From: | Rasmus Lerdorf | Date: | Thu, 26 Apr 2001 00:39:03 +0000 |
| Subject: | Re: PHP FREE MEMORY | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50400@lists.php.net to get a copy of this message | ||
> if I put the following piece of code in a forloop does it use more memory or
> does it use the same memory since the same variable result is being used:
>
> will it use up lots of memory if I execute it 1000 times or will it use the
> same memory.
>
>
> for (loop) {
>
> $result = mysql_query ("UPDATE A_TBL SET dog ='$var' WHERE type
> ='$var2'");
> $nr=mysql_affected_rows();
> if ($nr==0) { process error}
>
> }
It will re-use the same memory because of reference-count-based garbage
collection feature in PHP 4.
-Rasmus