Open Jonoox opened 5 years ago
I also notice that the library is not using PROGMEM anywhere. It uses huge dynamic memory (70% to 77%). Which is not good. So I think it should be modified.
@wonho-maker can you try to solve this issue? Its an major issue for me.
I have solve this issue of huge dynamic memory
I have solve this issue of huge dynamic memory
Does your forked library resolve the issue?
@theintel You might want to also look at the Adafruit_SH110x library. I compiled one of the examples for an Arduino Uno, which uses nearly 60% of the available code space, while only using 29% of the dynamic memory:
"Sketch uses 18770 bytes (58%) of program storage space. Maximum is 32256 bytes. Global variables use 614 bytes (29%) of dynamic memory, leaving 1434 bytes for local variables. Maximum is 2048 bytes."
However, it might make more sense to use an Atmega 2560, or an Atmega 1284P, for the extra memory, for use with a graphical display.
@Andy2No Thanks for that suggestion. It is the neatest solution.
I have solve this issue of huge dynamic memory
Does your forked library resolve the issue?
Yes
https://github.com/choudharyanil244/Adafruit_SH1106/commit/e51c33eab98f102e420b59a0e043e1986b249ad8
@choudharyanil244 Thanks a lot. I'll give it a go.
@choudharyanil244 Thanks a lot. I'll give it a go.
Sure try it out and let me know the results.
@choudharyanil244 I tried it out. I wanted to check the real-time dynamic memory usage using freeMemory() following this tutorial
I included Serial.println(freeMemory())
in different parts of the sketch and this was your library's result:
And this was the actual library's:
Sorry for dragging this old thread. I don’t exactly know if this represents optimization performance of the library. So someone's expertise would be helpful.
Hi, your lib in my program takes 1000 bytes more of dynamic memory than SSD1306 library.
Your library SH1106: The global variable use 1.577 byte (77%) of dynamic memory, leaving 471 byte free for local variables. The max is 2.048 byte. Low memory available, stability problems may occur.
SSD1306: The global variable use 563 byte (27%) of dynamic memory, leaving 1485 byte free for local variables.
That's because of you not using PROGMEM anywhere in library.