-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
RAM consumption of camera entity #52
Comments
I can see that if I remove all "map objects" my home assistant instance take 270Mo in Memory |
Since python is very slow at rendering the map images, i have added a layer caching mechanism for rendering only the modified objects on the map. The cost of caching layers is more ram usage but without the cache it would be using too much cpu instead and cpu is more precious resource than memory. |
Thanks for theses explications, I will take a look on the code to try to understand it. |
My specialty is c++ and this is my first python project (and probably the last) because of that there are room for improvements in the project. |
Also all map resources like robot image and room icons are cached on the memory too for preventing to load them everytime the map changes which adds a lot of render time otherwise. |
I am closing this issue since it can be solved by adding some swap memory on linux. I will release a custom card that renders the map on frontend to solve this issue completely. |
I have added a new option in the entity configuration for rendering the map half size and it lowers memory consumption enough to make the integration work on an 1GB RPI3. This option also disables some map objects like mop path for saving extra ram. https://github.com/Tasshack/dreame-vacuum/releases/tag/v2.0.0b6 |
Describe the bug
I tried to start to use this integration on a RPI3.
I can't due to RAM consumption.
To Reproduce
Start this integration on a raspberry on a docker.
Using docker I can see that:
Expected behavior
The camera entity should not take more that 300Mo to work
After some code analysis I can see that this RAM consumption come from call to
self._renderer.render_map(map_data, robot_status)
performed on 'camera.py' file at line 301.Additional Information (please complete the following information)
linked with #48 and #38
The text was updated successfully, but these errors were encountered: