Page 1 of 1

esp8266 not enough room to swing a python

Posted: Sun Jan 30, 2022 11:54 pm
by KJM
I've got an ancient 8266 with 32k ram & 3 meg of flash

Code: Select all

>>> import gc; gc.collect(); gc.mem_free()
32080
>>> import os; s=os.statvfs(''); print('%.3fkb free of %.3fkb'%(s[0]*s[3]/1048.576, s[0]*s[2]/1048.576))
2953.126kb free of 2980.470kb
but it won't run a 10k .mpy file. Given the .mpy is less than a third of the available ram I'm a bit surprised. Is there a rule-of-thumb for what percentage of ram an .mpy is allowed to be before it won't run?

Re: esp8266 not enough room to swing a python

Posted: Tue Feb 01, 2022 5:42 pm
by easylab4kids
Hi!

FYI. this is my Wemos D1 Mini' memory.
MicroPython v1.15-4-g5669a6095 on 2021-04-23; ESP module (1M) with ESP8266
Type "help()" for more information.
>>> import gc; gc.collect(); gc.mem_free()
33440
>>> import os; s=os.statvfs(''); print('%.3fkb free of %.3fkb'%(s[0]*s[3]/1048.576, s[0]*s[2]/1048.576))
3292.969kb free of 3382.813kb
>>>
Above is with some python code on it.