Skip to content
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

High dynamic memory usage by SH1106 library #11

Open
Jonoox opened this issue Sep 1, 2019 · 10 comments
Open

High dynamic memory usage by SH1106 library #11

Jonoox opened this issue Sep 1, 2019 · 10 comments

Comments

@Jonoox
Copy link

Jonoox commented Sep 1, 2019

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.

@muhit313
Copy link

muhit313 commented Sep 13, 2021

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.

@muhit313
Copy link

@wonho-maker can you try to solve this issue?
Its an major issue for me.

@choudharyanil244
Copy link

I have solve this issue of huge dynamic memory

@theintel
Copy link

I have solve this issue of huge dynamic memory

Does your forked library resolve the issue?

@Andy2No
Copy link

Andy2No commented Feb 20, 2023

@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.

@theintel
Copy link

theintel commented Feb 20, 2023

@Andy2No Thanks for that suggestion. It is the neatest solution.

@choudharyanil244
Copy link

choudharyanil244 commented Feb 20, 2023

I have solve this issue of huge dynamic memory

Does your forked library resolve the issue?

Yes

choudharyanil244@e51c33e

@theintel
Copy link

@choudharyanil244 Thanks a lot. I'll give it a go.

@choudharyanil244
Copy link

@choudharyanil244 Thanks a lot. I'll give it a go.

Sure try it out and let me know the results.

@theintel
Copy link

theintel commented Feb 21, 2023

@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:
Screenshot_20230221-045217

And this was the actual library's:
Screenshot_20230221-044957

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants