Free RAM on MicroPython boards

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
willie
Posts: 14
Joined: Mon Dec 14, 2015 12:05 am

Re: Free RAM on MicroPython boards

Postby willie » Wed Sep 14, 2016 8:09 am

I'd be interested in seeing measurements for Espruino Pico (I like that form factor) if someone has one. The Teensy 3.2 is also of interest.

User avatar
deshipu
Posts: 795
Joined: Thu May 28, 2015 5:54 pm

Re: Free RAM on MicroPython boards

Postby deshipu » Wed Sep 14, 2016 8:55 am

willie wrote:I'd be interested in seeing measurements for Espruino Pico (I like that form factor) if someone has one. The Teensy 3.2 is also of interest.


I have a pico, but the version of micropython on it is a bit old. Anyways, here's my result:

Code: Select all

MicroPython v1.5.2-21-g824f83f on 2016-01-04; Espruino Pico with STM32F401CD
Type "help()" for more information.
>>> import gc
>>> gc.collect()
>>> gc.mem_free()
54448

mad474
Posts: 60
Joined: Sun Dec 29, 2013 7:48 pm

Re: Free RAM on MicroPython boards

Postby mad474 » Wed Sep 14, 2016 5:32 pm

Code: Select all

MicroPython v1.8.4 on 2016-09-09; Espruino Pico with STM32F401CD
Type "help()" for more information.
>>> import gc
>>> gc.collect()
>>> gc.mem_free()
54336
>>>

edit: and after commenting out

Code: Select all

import machine
import pyb
in boot.py, the following result

Code: Select all

MicroPython v1.8.4 on 2016-09-09; Espruino Pico with STM32F401CD
Type "help()" for more information.
>>> import gc
>>> gc.collect()
>>> gc.mem_free()
54352
>>>

User avatar
Roberthh
Posts: 448
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Free RAM on MicroPython boards

Postby Roberthh » Thu Sep 15, 2016 10:00 am

Teensy 3.1:
Micro Python v1.4.5 on 2015-08-16; Teensy-3.1 with MK20DX256
Type "help()" for more information.
>>> import gc
>>> gc.collect()
>>> gc.mem_free()
52064

Update:
MicroPython v1.8.4-11-g0fd3d8d-dirty on 2016-09-15; Teensy-3.1 with MK20DX256
Type "help()" for more information.
>>> import gc
>>> gc.collect();gc.mem_free()
52112

danielm
Posts: 128
Joined: Mon Oct 05, 2015 12:24 pm

Re: Free RAM on MicroPython boards

Postby danielm » Thu Oct 06, 2016 9:40 am

Why in case of WiPy the heap size is less that quarter of total RAM size, when for other boards it is around half of the RAM size?

Are there any options how to build the CC3200 MP port with bigger heap size?

User avatar
Roberthh
Posts: 448
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Free RAM on MicroPython boards

Postby Roberthh » Thu Oct 06, 2016 10:06 am

In the course of another topic Damien epxlained that WiPy requires the code to be loaded into RAM and executed there. Therefore most of the RAM is reserved for the MicroPython code itself, leaving only 56k for heap.

rcolistete
Posts: 83
Joined: Thu Dec 31, 2015 3:12 pm

Re: Free RAM on MicroPython boards

Postby rcolistete » Tue Oct 18, 2016 4:06 pm

Updated the 1st post with measured free RAM for LoPy, Espruino Pico and Teensy 3.1.

User avatar
dhylands
Posts: 2110
Joined: Mon Jan 06, 2014 6:08 pm
Location: Shuswap, BC, Canada
Contact:

Re: Free RAM on MicroPython boards

Postby dhylands » Tue Oct 18, 2016 6:08 pm

Using my dev builds (not yet merged to master).

Teensy 3.1: 51952 (64K)
Teensy 3.5: 171120 (192K)
Teensy 3.6: 235120 (256K)

User avatar
Roberthh
Posts: 448
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Free RAM on MicroPython boards

Postby Roberthh » Wed Oct 19, 2016 7:57 am

The figures for teensy 3.5 and 3.6 look great. They seem to be a real alternative to PyBoard, especially the 3.6 model with the built-in ethernet controller.

User avatar
bmarkus
Posts: 105
Joined: Tue Oct 21, 2014 5:58 am

Re: Free RAM on MicroPython boards

Postby bmarkus » Wed Oct 19, 2016 1:03 pm

On a LoPy v1.0 board with stock firmware

Code: Select all

>>> import gc
>>> gc.collect()
>>> gc.mem_free()
191088
>>>
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)


Return to “General Discussion and Questions”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest