Use the freeResult DAO method
authorJon goldberg <jon@palantetech.coop>
Mon, 17 Jul 2017 04:50:42 +0000 (00:50 -0400)
committerJon goldberg <jon@palantetech.coop>
Mon, 17 Jul 2017 04:50:42 +0000 (00:50 -0400)
bin/cli.class.php

index d38259182464c6c975045b95590137719b39f208..5020e8171ba4ce18cc9b07ea8a930828c925c211 100644 (file)
@@ -432,11 +432,7 @@ class civicrm_cli_csv_file extends civicrm_cli {
       $this->row++;
       if ($this->row % 1000 == 0) {
         // Reset PEAR_DB_DATAOBJECT cache to prevent memory leak
-        $GLOBALS['_DB_DATAOBJECT']['RESULTS'] = array();
-        $GLOBALS['_DB_DATAOBJECT']['RESULTSEQ'] = 1;
-        $GLOBALS['_DB_DATAOBJECT']['RESULTFIELDS'] = array();
-        // Forces garbage collection
-        memory_get_usage(TRUE);
+        CRM_Core_DAO::freeResult();
       }
       $params = $this->convertLine($data);
       $this->processLine($params);