From 104affb51a8c0db24bc7b1a5ed3489a702164277 Mon Sep 17 00:00:00 2001 From: Madhav Kumar <78339236+Madhav-MKNC@users.noreply.github.com> Date: Thu, 21 Mar 2024 06:48:22 +0530 Subject: [PATCH] Set maxsize to 32MB in lru_cache() for reasonable memory usage --- checkpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkpoint.py b/checkpoint.py index 1d81e2e..2b08b42 100644 --- a/checkpoint.py +++ b/checkpoint.py @@ -141,7 +141,7 @@ def path_tuple_to_string(path: tuple) -> str: For get_load_path_str(), introducing a simple caching mechanism to avoid recomputing regex matches for paths that have already been processed. """ -@lru_cache(maxsize=None) +@lru_cache(maxsize=32) # Set maxsize to 32MB def get_load_path_str_cached( init_path_str: str, load_rename_rules: Optional[list[tuple[str, str]]] = None,