core/main: set GC threshold to 25%

memory-fix
Pavol Rusnak 5 years ago
parent defb50a731
commit 573204fceb
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -16,7 +16,6 @@ async def sign_tx(ctx, received_msg, keychain):
if __debug__:
log.debug(__name__, "#### F: %s, A: %s", gc.mem_free(), gc.mem_alloc())
gc.collect()
gc.threshold(gc.mem_free() // 4 + gc.mem_alloc())
result_msg, accept_msgs = await sign_tx_dispatch(state, received_msg, keychain)
if accept_msgs is None:

@ -15,6 +15,12 @@ usb.bus.open()
utils.set_mode_unprivileged()
# set GC threshold to 25% of the heap capacity
import gc
gc.threshold(gc.mem_free() // 4 + gc.mem_alloc())
def _boot_recovery() -> None:
# load applications
import apps.homescreen

Loading…
Cancel
Save