Comments (12)
When memory is exhausted,it output this debug.I think that it may be something wrong with library
Warn: Image draw cannot open the image resource (/home/fyy/esp/project/lv_port_esp32_ili9341/components/lvgl/lvgl/src/lv_draw/lv_img_cache.c #118)
Warn: Image draw error (/home/fyy/esp/project/lv_port_esp32_ili9341/components/lvgl/lvgl/src/lv_draw/lv_draw_img.c #61)
error 83: memory allocation failed
from lv_port_esp32.
I found that if I create over two images objects,it will recall decoder_open function all the time,which reduce the memories.
from lv_port_esp32.
I can't see enough of your code to know exactly what you're doing, but it sounds like you are creating new image objects over and over. You don't need to do that. Just change the source of the existing image object(s).
Again, not much code to work with here, but I'm guessing that your UI has current and next weather images? That means you only need two image objects, and you can just change the sources of them as necessary. You don't need to create new ones each time you want a different image.
If, for some reason, you really need to create a new image object, remember that you should delete the first one with lv_obj_del
. Otherwise it stays on the screen and keeps consuming memory.
from lv_port_esp32.
@embeddedt Actually,I do need to create several images and change them day by day. Like you say,If I delete the images object,how can I change the source of picture.
from lv_port_esp32.
I find the real reason,when I create two imge objects and a scrolled label ,there is a conflict between image and scrolled label,I post the code here (https://github.com/donny681/littlevgl_esp32).You can see that the it will reduce memories gradually if it creates two image object and a scrolled label.
from lv_port_esp32.
I do need to create several images and change them day by day.
As I mentioned, you can change the source of an image after it's created by calling lv_img_set_src
again. There is no need to recreate/delete the image object.
Hmm. I don't see anywhere in your code that you are changing the image. You seem to just create it once in my_demo_create
and then do nothing afterwards. Is my_demo_create
ever called again after this line? Could you explain what parts of your code are relevant to the issue in more detail?
You can see that the it will reduce memories gradually if it creates two image object and a scrolled label.
I very much doubt this is the cause. It's more likely that the label just speeds up the exhaustion of heap space because it uses some memory to store the text.
Please check that you are not recreating objects multiple times. LittlevGL does not work like some other libraries where you have to call a "drawText" API or something similar in a loop. For LittlevGL creating an object once and then updating it later
from lv_port_esp32.
No,I think that you misunderstand my meaning.As you mentioned.I do nothing after creating the UI.However,I don't know the reason why it contnued to reduces memories every second If I create two images and a scrolled label after doing nothing.There are five steps to prove the problems.
Firstly,just create two images then do nothing,the memonies are stable for a long time after a few seconds.
Secondly,If I create two images and a scrolled label .However,it resuces the memonies every second.After a few minutes all the memonies are exhausted because the scrolled label consumes the memonies every second.
Thirdly,if I just create only one images and a scrolled label,the memonies are still stable for a long time.
Forthly,if I just create a scrolled label,the memonies are still stable for a long time after a few seconds.
Finally,If I create several images and the memonies are still stable for a long time after a few seconds.
Therefore,it is not a matter of how many images you create.I just want to know why memonies are used out finally when creating some images and a scrolled label.
from lv_port_esp32.
I was able to reproduce the issue and found the problem. lodepng
loads the PNG file into buffer, and this buffer wasn't freed.
I've fixed it here: lvgl/lv_lib_png@5018378
I hope it solves your issue.
from lv_port_esp32.
@kisvegabor it works.Thank you.
from lv_port_esp32.
@kisvegabor However,when I try to change the text of other static label.It will affect the original scrolled label .For example,if I create two images ,a scrolled label and a static label.If I want to change the text of the static label.Actually it change the text of scrolled label.
If I just create two images and a static label.It is ok to change the text of static label.
from lv_port_esp32.
Please send a code snippet?
Do you see the issue without the images too?
from lv_port_esp32.
Sorry,It is my fault .I do something wrong with it personally.
from lv_port_esp32.
Related Issues (20)
- Cannot build project with LVGL as component HOT 1
- SPI display drivers do not play nice with other spi devices
- esp32-s3 invalid dma channel HOT 1
- Portrait mode of demos doesn't display correctly
- The link to the forum when you write a PR/issue is incorrect HOT 1
- build with esp-idf-4.4.3 fails HOT 1
- failed to run idf.py menuconfig HOT 2
- updated LVGL+squareline studio+ ESP32 HOT 2
- Demo on older esp-wrover-kit board ( not v4.1) HOT 2
- Display not showing the correct windows while running this example HOT 2
- Sunton ESP32-8048S070 board HOT 8
- How can I add my own components to the project
- Unable to compile on esp-idf version 5.0 HOT 4
- undefined reference to `lv_obj_set_scroll_propagation'
- Cant turn off LV_USE_FLEX
- Horizontal scrolling HOT 4
- fatal error: Arduino_H7_Video.h: No such file or directory
- ESP32C3 - non-LVGL task (temp reading) causes TFT display to go blank and stay blank on second run of task HOT 1
- ssd1306 driver
- ssd1306
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lv_port_esp32.