memory and small int overflow error

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
deepak
Posts: 8
Joined: Sun Apr 19, 2020 5:20 pm

memory and small int overflow error

Post by deepak » Fri May 29, 2020 4:53 pm

Hi,

I have ported minimal micropython to a RTOS, in which core micropython is ported only.
for which i have compiled lib/utils/pyexec.c, lib/utils/stdout_helpers.c, lib/mp-readline/readline.c, minimal/main.c, minimal mpconfigport.h, ports/unix/unix_mphal.c and py files which are described in py.mk.

so when I tried to perform 2-d matrix multiplication of 2 matrix, 1000 times, then it was giving memory error. matrix size 4x4.
can you tell me how can I fix that error and increase the memory size.

In addition to above, when I tried to perform 1-d matrix multiplication of 2 matrix, then it was giving small int overflow. matrix size 10000x10000.

can you help me in this?

Thanks
Last edited by deepak on Thu Jun 04, 2020 10:29 am, edited 1 time in total.

User avatar
jcw
Posts: 35
Joined: Sat Dec 21, 2019 12:08 pm
Location: CET/CEST

Re: memory and small int overflow error

Post by jcw » Fri May 29, 2020 10:47 pm

The memory error may be caused by not having GC enabled (#define MICROPY_ENABLE_GC 1), as don't have "gc.c" in your list.
For the int overflow, my hunch would be that you need multi-precision support (#define MICROPY_LONGINT_IMPL 1).

deepak
Posts: 8
Joined: Sun Apr 19, 2020 5:20 pm

Re: memory and small int overflow error

Post by deepak » Wed Jun 03, 2020 3:18 pm

jcw wrote:
Fri May 29, 2020 10:47 pm
The memory error may be caused by not having GC enabled (#define MICROPY_ENABLE_GC 1), as don't have "gc.c" in your list.
For the int overflow, my hunch would be that you need multi-precision support (#define MICROPY_LONGINT_IMPL 1).
Thanks, int oveerflow issue has been resolved by #define MICROPY_LONGINT_IMPL 1.
But memory overflow error is still there, even after enabling GC.

Post Reply