Free up some memory by unsetting large arrays in backend copy script.
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 18 Jul 2012 06:25:30 +0000 (23:25 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 18 Jul 2012 06:25:30 +0000 (23:25 -0700)
Change-Id: I55b6a6f8228370d948821dcd4de22fda51539fd0

maintenance/copyFileBackend.php

index 544f48b..498bc6b 100644 (file)
@@ -90,6 +90,8 @@ class CopyFileBackend extends Maintenance {
                                // Only copy the missing files over in the next loop
                                $srcPathsRel = array_diff( $relFilesSrc, $relFilesDst );
                                $this->output( count( $srcPathsRel ) . " file(s) need to be copied.\n" );
+                               unset( $relFilesSrc );
+                               unset( $relFilesDst );
                        }
 
                        $batchPaths = array();