Bug #66372 [Opn->Fbk]: Garbage collection issue
| From: | krakjoe@php.net | Date: | Tue, 31 Dec 2013 08:24:37 +0000 |
| Subject: | Bug #66372 [Opn->Fbk]: Garbage collection issue | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183507@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66372&edit=1
ID: 66372
Updated by: krakjoe@php.net
Reported by: nikcomestotalk at gmail dot com
Summary: Garbage collection issue
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: Linux
PHP Version: 5.4.23
Block user comment: N
Private report: N
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Previous Comments:
------------------------------------------------------------------------
[2013-12-31 07:35:50] nikcomestotalk at gmail dot com
Description:
------------
Memory getting exhausted when a php script[staticarray.php] is included multiple times.
staticarray.php size is 221K and which contain only arrays
Example
memcheck.php[Code shown in test script]
When i simply execute this
02.75 mb
12.75 mb
22.75 mb
32.75 mb
42.75 mb
52.75 mb
62.75 mb
72.75 mb
82.75 mb
92.75 mb
102.75 mb
I have used include_once, still memory usage keeps getting up.
Steps i had taken to stop memory usage, but went in vain
1. use gc_enable
2. put unset(Variable name) above every array creation
Test script:
---------------
//Memcheck.php
<?php
for($i=0;$i<10;$i++)
{
include_once("staticarray.php");
echo "\n $i". convert(memory_get_usage(true));
}
$CITY_DROP=array();
echo "\n $i". convert(memory_get_usage(true));
function convert($size)
{
$unit=array('b','kb','mb','gb','tb','pb');
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
}
?>
Expected result:
----------------
I expect memory usage should be same throughout.
02.75 mb
02.75 mb
02.75 mb
02.75 mb
02.75 mb
02.75 mb
02.75 mb
02.75 mb
02.75 mb
02.75 mb
02.75 mb
Actual result:
--------------
02.75 mb
12.75 mb
22.75 mb
32.75 mb
42.75 mb
52.75 mb
62.75 mb
72.75 mb
82.75 mb
92.75 mb
102.75 mb
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66372&edit=1