Hmmm... if you are using r0X series, having more modules will take up more RAM.
If you are using v10 branch, then more modules will take up more Flash. It might be possible to do what you say. But there is module caching that you'll have to comment out. See src/lib/__bi.py line 944 (variable __md) and src/vm/interp.c line 1469 where the IMPORT_NAME bytecode stores a reference to the module in the __md dict.
You have to get rid of those extra reference so that after "del modulename" there are no reference to the module and the garbage collector can whisk it away.
!!Dean
On Apr 24, 2013, at 7:58 PM, GilRoss wrote:
> My system has 30k dedicated to the Python heap. I've written a module (along with the imported modules) that uses all this memory. Is it possible to break this one module into two modules: Mod1, Mod2, then have a 3rd module (ModMaster) import these subordinate modules one at a time such that only one is using Python heap memory at any one time? That is, import Mod1 into the heap, use it, remove Mod1 from the heap, import Mod2 into the heap, use it, remove Mod2 from the heap.
>
> Gil
>
> --
> --
> You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
> Site:
http://groups.google.com/group/python-on-a-chip
>
> ---
> You received this message because you are subscribed to the Google Groups "python-on-a-chip" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
python-on-a-ch...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>