esp8266 not enough room to swing a python

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
KJM
Posts: 158
Joined: Sun Nov 18, 2018 10:53 pm
Location: Sydney AU

esp8266 not enough room to swing a python

Post by KJM » Sun Jan 30, 2022 11:54 pm

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?

easylab4kids
Posts: 20
Joined: Mon Aug 12, 2019 10:58 am
Location: Ellisras, Suid-Afrika ("South Africa")

Re: esp8266 not enough room to swing a python

Post by easylab4kids » Tue Feb 01, 2022 5:42 pm

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.
met vriendelijke groet,
Easylab4kids.nl

Post Reply