diff --git a/core/src/trezor/utils.py b/core/src/trezor/utils.py index 0badae4db..bd5191ee1 100644 --- a/core/src/trezor/utils.py +++ b/core/src/trezor/utils.py @@ -19,9 +19,11 @@ if __debug__: TEST = int(uos.getenv("TREZOR_TEST") or "0") SAVE_SCREEN = int(uos.getenv("TREZOR_SAVE_SCREEN") or "0") + LOG_MEMORY = int(uos.getenv("TREZOR_LOG_MEMORY") or "0") else: TEST = 0 SAVE_SCREEN = 0 + LOG_MEMORY = 0 def unimport_begin(): diff --git a/core/src/trezor/workflow.py b/core/src/trezor/workflow.py index 92ec261d4..c565c9478 100644 --- a/core/src/trezor/workflow.py +++ b/core/src/trezor/workflow.py @@ -18,6 +18,13 @@ def onclose(w): if not layouts and default_layout: startdefault(default_layout) + if __debug__: + import micropython + from trezor import utils + + if utils.LOG_MEMORY: + micropython.mem_info() + def closedefault(): global default