memory tweaking
This commit is contained in:
parent
55d4db51a0
commit
6de52244ae
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "jo3util"
|
name = "jo3util"
|
||||||
version = "0.0.3"
|
version = "0.0.5"
|
||||||
description = ""
|
description = ""
|
||||||
dependencies = []
|
dependencies = []
|
||||||
dynamic = ["readme"]
|
dynamic = ["readme"]
|
||||||
|
|
|
@ -16,9 +16,9 @@ def sizeof_fmt(num, suffix='B'):
|
||||||
num /= 1024.0
|
num /= 1024.0
|
||||||
return "%.1f %s%s" % (num, 'Yi', suffix)
|
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. """
|
""" 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)
|
variables_with_sizes = ((name, sys.getsizeof(value)) for name, value in variables)
|
||||||
|
|
||||||
if not top:
|
if not top:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user