-
Notifications
You must be signed in to change notification settings - Fork 7
Example sketches always report the same values? #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
FYI I tried using the previous release of MemoryUsage (v2.20.0).
|
For the problem of architecture, its fixed with the new lib 2.21.1. |
(Argh... I just lost the longer comment I was typing up. I will break it up to smaller topics.) Your v2.21.1 release now has its examples listed for Arduino Uno. Thanks. I will do some more investigation into why the examples have results which do not seem to change. |
I cloned the MemoryUsage repository and instrumented the code to learn more about what the examples are doing. The |
The Unfortunately since I added an extra I think the On my branch I am turning the |
I think the library and examples are technically behaving correctly (except for minor issues #6 and #5). However the compiler optimizer passes make the examples much less interesting. After optimization many expected side effects disappear:
All good in principle. But the optimizations make it difficult to predict how much stack space is needed, just by inspection. Even for a simple example. Often nothing seems to change, especially for simple examples. I was able to get more predictable results by:
I found it useful to modify the MemoryUsage library to support new (inline) functions to return numeric values for stack size, heap size etc.. This lets me numerically compare measured values against my expectations, measure deltas, print values in hex, etc.. I wrote a unit test to help me ensure my expectations matched what the compiler actually does. In all, I am VERY happy with how MemoryUsage is working for me. It is a good tool for understanding how much work the optimizers have done to improve performance on your code, and how much memory your code still needs. Thank you for providing these abstractions! |
Hi. Thank you for publishing this library. I wanted to make something similar, but it was good to see you had a library already available!
Unfortunately, I have not been able to get MemoryUsage to report any changing values for the example sketches (or for my own sketches). I expected the examples to report changing values as storage was allocated and released. Am I using the library incorrectly?
My environment:
I tried to run the example sketches "FreeRam" and "Stack".
NOTE 1:
The MemoryUsage examples are under File/Examples/INCOMPATIBLE/MemoryUsage...
The examples seemed to compile anyway.
NOTE 2: Stack.ino
Stack.ino builds with the following warning:
The sketch output gives values that never change. For example stack size is always 1256 bytes:
These values were supposed to change (at least temporarily), correct?
NOTE 3: FreeRam.ino
FreeRam.ino builds with the following warning:
The sketch output gives values that never change. For example the free RAM size is always 1850 bytes:
Again, these values were supposed to change (at least temporarily), correct?
The text was updated successfully, but these errors were encountered: