From 6de52244aeeedc44693a72f6a9715618402cea30 Mon Sep 17 00:00:00 2001 From: JJJHolscher Date: Tue, 12 Dec 2023 14:54:47 +0100 Subject: [PATCH] memory tweaking --- pyproject.toml | 2 +- src/memory.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aa0ebb8..a643300 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "jo3util" -version = "0.0.3" +version = "0.0.5" description = "" dependencies = [] dynamic = ["readme"] diff --git a/src/memory.py b/src/memory.py index bd745d8..f20d05e 100644 --- a/src/memory.py +++ b/src/memory.py @@ -16,9 +16,9 @@ def sizeof_fmt(num, suffix='B'): num /= 1024.0 return "%.1f %s%s" % (num, 'Yi', suffix) -def print_largest_variables(top=10): +def print_largest_variables(variables, top=10): """ Print the names and sizes of the top largest variables. """ - variables = list(locals().items()) + variables = list(variables.items()) variables_with_sizes = ((name, sys.getsizeof(value)) for name, value in variables) if not top: