Version 1.5.0 does crash on my device (SAP6_IA) quite frequently. Thi… #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Version 1.5.0 does crash on my device (SAP6_IA) quite frequently. This happens particularly predictably when alternating correct measurements with errors (magnetic, laser). Debugging revealed that most frequently there occured memory errors in "create_big_text_group" followed by "measure" (pops up as an "outer memory error") and quite seldomly somewhere else, e.g. when opening the menu. Apparently, there is no real memory problem, but the crappy garbage collection of embedded python cannot handle the fast switches or some such. To reduce memory impact and so indirectly the gc problem, I replaced the most frequent error messages by images (you could of cause create an image with the message text - I did more like some pictograms :). The result is much better but not perfect. Therefore, I also put some try/catch around the memory intensive processes. this seems to come without any obvious penalty and does not impact sending measurements via bluetooth. Just there is no text displayed in case of a caught memory error and in most cases the gc seems to catch up then somewhere downstream. So with these two modifications my device now works like a charm, with no critical out of memory errors whatsoever, anymore. In case the described problem occurs for others, too, I propose to include these modifications in the main branch (or at least the image-part).