How to clear all scripts in mp
How to clear all scripts in mp
I'm currently using micropython to execute scripts that are sent over the air to my device. The scripts are kept in FLASH until its time for their execution by mp. What I would like to do is after a script executes, remove it from RAM. Is there a function for removing mp scripts from the heap?
Re: How to clear all scripts in mp
The list of all loaded modules is kept in the dictionary sys.modules. if 'my_module' has been loaded, you'll find it in that list. You can remove it from that module with
The, you can load that module again. But I analysed, whether that frees RAM..
Code: Select all
del sys.modules['my_module']