Is 32kByte enough for micropyhton?

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
eduardo
Posts: 31
Joined: Mon Jan 05, 2015 6:48 pm

Is 32kByte enough for micropyhton?

Post by eduardo » Wed Aug 19, 2015 8:09 pm

Some cores like Arm M0 do only have 32kByte RAM.

Did someone already port Micropython to any 32kByte Core?

Thank you

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

Re: Is 32kByte enough for micropyhton?

Post by dhylands » Wed Aug 19, 2015 8:33 pm

Micropython doesn't really need much RAM. The real question is will 32K be enough for your python scripts to run in?

Your source code will be compiled to bytecode and that bytecode needs to fit in RAM. Then your script may further allocate objects. Whether 32K is enough depends entirely on the script.

On the pyboard, 16K is set aside for stack, and MicroPython itself uses about 10K of RAM for static objects. A big chunk of that is for the USB serial and USB Mass Storage support.

The stack can obviously be cut back, and if you're using a HW UART for the REPL instead of USB-serial then the 10K can be cut back quite a bit as well.

eduardo
Posts: 31
Joined: Mon Jan 05, 2015 6:48 pm

Re: Is 32kByte enough for micropyhton?

Post by eduardo » Thu Aug 20, 2015 6:57 am

So it might be absolutely doable to run 100.000 instances of micropython (e.g. to simulate neurons) on this massively
connected machine of 100.000 cores with 32kbyte of RAM each.

http://apt.cs.manchester.ac.uk/projects ... r/project/

The next machine which will have 1 mio cores (which is currentlty build and is part of human genome project) will be free to be used.

The hardest part for brain researchers will be to program this beast. Here might micropython come for help.

Interpreted code performance of micropython would not matter, as the network is the bottleneck anyway.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: Is 32kByte enough for micropyhton?

Post by Damien » Mon Aug 24, 2015 7:18 am

64k might be a bit more comfortable especially if you need code to communicate with other instances across the network. If the machine is 64 bit then you'll need double the RAM compared with a 32 bit machine.

Post Reply