-
Notifications
You must be signed in to change notification settings - Fork 26
System memory overflow in SAM9X60_Curiosity when using EGT #31
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
Hi, Could you try to track the memory usage of you process, with a tool such as top. We are aware of a memory leak in the kernel driver of the LCD controller. I'm wondering if it can be the cause of your memory leak. If the memory of your process, doesn't increase, check /proc/meminfo to see where there is a significant increase of the memory. Then I could confirm if it comes from the driver of the LCD controller. Regards, |
Hello Ludovic, Thanks for your help. Is there any other way to display multiple images (with or without "EGT") without increasing memory consumption? Thanks again. Regards. |
Hello, From what I see, the driver doesn't seem to be involved in the memory leak. So something is wrong in the application or EGT. Can you provide a code snippet to reproduce it. There is not enough context with the code you shared to let me understand how you did. Which version of EGT are you using. Regards, |
Hi Ludovic, Thank you for your help. The Linux version is: We couldn't get the EGT version (how do I get it?). Below is a complete example code and also the project. Start code: static std::string getWorkDir() int main(int argc, char** argv)
} Complete code: In the example an image will be shown every 2 seconds, and then the next image will be shown. Thanks again. Regards. |
Hi Zarath, To get the EGT version, you have to set the EGT_DEBUG environment variable. 2 is enough to get info messages. If you have compiled EGT with debug enable, you can set it to 1. Then you get debug messages. From what I observed with the code you provided, there is no memory leak. I let the app run several minutes and the memory usage doesn't change. If you don't want this mechanism, you can clear the cache after each image you load: ` [...] image->image(egt::Image{imagePaths[index]}); [...] ` Doing this, I don't observe an increase of the memory usage. Let me know if it fixes the issue on your side as well. Regards, Ludovic |
Hi Ludovic, The solution you proposed worked perfectly, making a significant difference in the progress of our work. We would like to kindly request a link to a website where we can access the complete EGT documentation. Once again, thank you very much! Your help has been extremely valuable. Best regards, |
Hi Zarath, That's great. Here is the EGT documentation, but you probably already know it: https://linux4sam.github.io/egt-docs/index.html Regards, |
Hi Ludovic, Once again, thank you very much! Regards. |
We used the SAM9X60_curiosity kit.
In the example snippet below, we displayed an image (png) for 2 seconds and then replaced it with another.
#include <egt/ui>
#include <egt/widget.h>
#include <egt/label.h>
void DisplayController::ShowPicture(int figure)
{
string path;
switch (figure)
{
case 1:
path = "root\images\Picture1.png";
break;
case 3:
path = "root\images\Picture2.png";
break;
case 3:
path = "root\images\Picture3.png";
break;
case 4:
path = "root\images\Picture4.png";
break;
case 5:
path = "root\images\Picture5.png";
break;
}
imagemBackground->image(egt::Image(path));
thisWindow.damage();
thisWindow.show();
resetTimer.change_duration(std::chrono::milliseconds(2000));
resetTimer.start();
}
This work with excellent image quality and no flickering on the screen, but after displaying each image, system memory consumption increases.
If we display about 30 images, Linux crashes due to lack of memory (this can be seen by the command "free -h"
What is the method to deallocate an image from memory after displaying it?
The text was updated successfully, but these errors were encountered: