diff options
-rw-r--r-- | synapse/util/caches/lrucache.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py index fdf3b726b0..b018733288 100644 --- a/synapse/util/caches/lrucache.py +++ b/synapse/util/caches/lrucache.py @@ -44,6 +44,10 @@ try: recurse: If true will include referenced values in the size, otherwise only sizes the given object. """ + # Ignore singleton values when calculating memory usage. + if val in ((), None, ""): + return 0 + sizer = Asizer() sizer.exclude_refs((), None, "") return sizer.asizeof(val, limit=100 if recurse else 0) |