LoPy Stack and Heap Memory



  • Is there a way to check the stack memory? I know gc.mem_free() will show free memory but that's not the stack.



  • @robert-hh Thank you Robert! That's exactly what I was looking for.



  • @ssmith look at the module gc, methods gc.mem_free() and gc.mem_alloc(), or module micropython, methods micropython.stack_use() and micropython.mem_info(). The latter can be called as micropython.mem_info(True), showing more detail.



  • @bucknall , Is there a way to determine how much stack is in use and how much is available? We are using several threads and classes in our code and have run across strange errors that point to a stack overflow. I'd like to be able to verify if that is the actual cause.

    Thanks,
    Steve


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.