ram usage
-
- Posts: 89
- Joined: Fri Sep 11, 2015 10:47 pm
- Location: Italy
Re: ram usage
You can try this:
Code: Select all
import io
import os
class DUP(io.IOBase):
def __init__(self, s):
self.s = s
def write(self, data):
self.s += data
return len(data)
def readinto(self, data):
return 0
s = bytearray()
os.dupterm(DUP(s))
machine.info(1)
os.dupterm(None)
Re: ram usage
The main useful stats from micropython.mem_info() is the "GC: total: 2072832, used: 3264, free: 2069568" line.
You can get these three numbers using "gc.mem_alloc()" and "gc.mem_free()"
But if you want the other stats, then yeah the dupterm idea works nicely
You can get these three numbers using "gc.mem_alloc()" and "gc.mem_free()"
But if you want the other stats, then yeah the dupterm idea works nicely
Re: ram usage
Those 3 numbers are all I'm looking for. Thanks