From b6632519524a7e5615eb283fa4c4f5076008ab3a Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Sun, 21 Jan 2024 12:28:17 -0600 Subject: [PATCH 1/2] Update expandFns.php --- expandFns.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/expandFns.php b/expandFns.php index 626902631f..2f6bfc0189 100644 --- a/expandFns.php +++ b/expandFns.php @@ -45,15 +45,18 @@ public static function check_memory_use() : void { 2*count(self::$cache_hdl_loc) + // These include a path too count(self::$cache_hdl_null); if ($usage > self::MAX_CACHE_SIZE) { - self::$cache_active = []; - self::$cache_inactive = []; - self::$cache_good = []; - self::$cache_hdl_loc = []; - self::$cache_hdl_bad = self::BAD_DOI_ARRAY; - self::$cache_hdl_null = []; - gc_collect_cycles(); + self::free_memory(); } } + public static function free_memory() : void { + self::$cache_active = []; + self::$cache_inactive = []; + self::$cache_good = []; + self::$cache_hdl_loc = []; + self::$cache_hdl_bad = self::BAD_DOI_ARRAY; + self::$cache_hdl_null = []; + gc_collect_cycles(); + } } From 1de9e82f07392f112c1cdca75387d965ffc26c91 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Sun, 21 Jan 2024 12:31:04 -0600 Subject: [PATCH 2/2] Update big_jobs.php --- big_jobs.php | 1 + 1 file changed, 1 insertion(+) diff --git a/big_jobs.php b/big_jobs.php index 15c0721d08..184b7e674d 100644 --- a/big_jobs.php +++ b/big_jobs.php @@ -29,6 +29,7 @@ function big_jobs_name() : string { // NEVER save this string. Always use this f /** @param resource $lock_file **/ function big_jobs_we_died($lock_file) : void { + HandleCache::free_memory(); @fclose($lock_file); hard_unlink(big_jobs_name()); }