Closed
Description
6e8ff9c marks first (previously discussed) step towards port-independent heap monitoring functions. Next step would be to merge useful things from pyb.info() function, but I'd like to think step ahead and consider how to tweaks function(s) to optimize their usefulness in real-world scenarios.
Few ideas:
- Would be nice to have affinity towards printing single line of info - to minimize spam when used in quick loops, etc.
- Would be nice to by default print short, the most useful information. For example, free/used heap sizes are the most useful params. Next in my list would be size of the largest allocatable free block - based on existing fragmentation reports (we don't have such param repored now, and it's arguably expensive). Next would be stack usage, etc. Things like "largest allocated blocks" and "number of 1-block allocs" goes to tail of the list - I so far see it as a nice trivia, but not really useful for more or less general purpose. Different levels of output may/should be controlled by optional arg to function(s).
- There may be need for some flexibility. For example, I'd like see function to dump heap usage bitmap as a single line - to capture progress over time without gross log spamming, to be used with separate visualizations tools. And yet, there would be nice to have functions which uses ASCII art to dump heap state in human-readable form. Again, this can be controlled by function arguments.