Search found 969 matches

by kevinkk525
Mon Sep 24, 2018 7:42 am
Forum: General Discussion and Questions
Topic: Remove imported module from RAM
Replies: 62
Views: 49830

Re: Remove imported module from RAM

I try to avoid having lists as they have to be reallocated when appending items, but I have a lot of classes, class instances and functions.
by kevinkk525
Mon Sep 24, 2018 7:39 am
Forum: General Discussion and Questions
Topic: [SOLVED] Unloading modules frees RAM only when unloading root package
Replies: 15
Views: 8577

Re: [BUG?] Unloading modules frees RAM only when unloading root package

Allright, here you go: https://raw.githubusercontent.com/kevinkk525/pysmartnode/dev/pysmartnode/utils/subscriptionHandlers/test.py That's the file I used for the 2nd test (the 1st was with your function inside this file). You have to create the structure yourself, or clone the repository dev branch.
by kevinkk525
Mon Sep 24, 2018 7:29 am
Forum: General Discussion and Questions
Topic: [SOLVED] micropython.native in frozen bytecode
Replies: 8
Views: 4155

Re: micropython.native in frozen bytecode

Hmm sounds rather complicated. Doubt that anyone would want to put that effort into the cross-compiler just to get some more performance.
Thanks for you answers!
by kevinkk525
Sun Sep 23, 2018 4:59 pm
Forum: General Discussion and Questions
Topic: Remove imported module from RAM
Replies: 62
Views: 49830

Re: Remove imported module from RAM

oh I did not see that file the first time. The file is 2MB big, has a lot in it. QSTRs of all my modules and strings, a lot of (const bytes*), a lot of these: // frozen bytecode for file _testing/utils/subscribe_file.py, scope _testing_utils_subscribe_file__lt_module_gt__printMemory STATIC const byt...
by kevinkk525
Sun Sep 23, 2018 4:51 pm
Forum: General Discussion and Questions
Topic: [SOLVED] Unloading modules frees RAM only when unloading root package
Replies: 15
Views: 8577

Re: [BUG?] Unloading modules frees RAM only when unloading root package

Allright, here's a MCVE: I'm using the function you suggested in the module pysmartnode.utils.subscriptionHandlers.test: def b(): b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b();b(); return 0 All ...
by kevinkk525
Sun Sep 23, 2018 3:58 pm
Forum: General Discussion and Questions
Topic: Remove imported module from RAM
Replies: 62
Views: 49830

Re: Remove imported module from RAM

As far as I can tell, no .c file holds my code. All files are inside ports/esp8266/build/frozen_mpy/ as .mpy
Apart from that there is code in ports/esp8266/build/build/frozen_mpy.o
There is nothing in ports/esp8266/build/build/frozen.o

I just followed the official instructions for freezing modules.
by kevinkk525
Sun Sep 23, 2018 3:11 pm
Forum: General Discussion and Questions
Topic: Remove imported module from RAM
Replies: 62
Views: 49830

Re: Remove imported module from RAM

what result?
I put all my modules into ports/esp8266/modules folder and build the firmware..
by kevinkk525
Sun Sep 23, 2018 2:16 pm
Forum: General Discussion and Questions
Topic: Remove imported module from RAM
Replies: 62
Views: 49830

Re: Remove imported module from RAM

Guess I don't know what you mean by FROZEN_STR.
My modules are frozen bytecode as part of the firmware. The strings of the configuartion are in these files and are not getting modified in any way and therefore stay in flash.
by kevinkk525
Sun Sep 23, 2018 8:23 am
Forum: General Discussion and Questions
Topic: Remove imported module from RAM
Replies: 62
Views: 49830

Re: Remove imported module from RAM

My problem is, that I have many mutable objects like classes and class instances, which can not be changed to be immutable. Therefore I tried loading some of these only when needed and then unload them. After importing the neccessary modules like uasyncio, mqtt_as, an mqtt_handler written by myself ...
by kevinkk525
Sun Sep 23, 2018 7:38 am
Forum: General Discussion and Questions
Topic: [SOLVED] micropython.native in frozen bytecode
Replies: 8
Views: 4155

Re: micropython.native in frozen bytecode

ok so if I use frozen modules, I can't benefit from the native emitter because only the internal compiler of micropython can do that?