PHP memory issue do you need to undo?

What happens if you don't disconnect the array before the script runs?

I run thousands of CSV files by analyzing data for hundreds of thousands of clients in arrays. It works great for the first 5/6 hours, and then it starts to get sick badly.

I run about 5-10 CSVs for execution ... I wonder if this will help remove arrays in the script or not ... I thought they would not be allocated after the script ends. I am wrong?

+3
source share
5 answers

As far as I know, arrays - like all memory - should die when the script does.

PHP script PHP ? "include", , , "" PHP , .

+1

, script. memory_get_peak_usage() memory_get_usage()? .

+1

script. PHP. .

0

, , PHP . PHP 5.3 , . (http://www.php.net/manual/en/features.gc.performance-considerations.php) 5.3, , gc_collect_cycles() ( ).

0

Unsetjust destroys the variable - it does not free memory. If this behavior occurs after several hours of work, and this is a one-time script, it is possible to split the CSV files into smaller blocks in order to speed up the work and help find out where the problem arises.

0
source

All Articles