Closed mjaskula closed 1 year ago
Converting to draft as it appears this change breaks the uf2 stuff
Loading on demand, this is nice. Great work!
Converting to draft as it appears this change breaks the uf2 stuff
I think i've fixed the uf2 build, but I have not yet tested it. I've never built it before. If someone can verify it easily, I would love the confirmation. If not I'll get to it in the next few days.
Ok, i've tested the uf2 build locally, and it seems good to me.
This PR adds several improvements to the menu system.
Recently several new scripts were added pushing the allocated memory during menu load over the limit, causing it to crash. Running a
gc.collect()
during the import process alleviates the issue. Though I don't fully understand why, since python should perform a gc if it can't allocate.During the debug of the above issue I discovered that memory used by the import of all of the scripts at menu load time is never released. This means that a script launched by the menu has less memory available to it than one launched as
main.py
. I changed the way menu works such that the list of scripts is only imported when the menu is needed, and the launch of the chosen script happens the same way no matter if the menu is loaded or not. The result is more memory for scripts and a faster load time when the menu isn't needed.Summary of changes:
gc.collect()
to allow the menu to load