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 memory usage #53

Open
patzly opened this issue Feb 18, 2022 · 4 comments
Open

High memory usage #53

patzly opened this issue Feb 18, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@patzly
Copy link
Owner

patzly commented Feb 18, 2022

The memory usage of Doodle is very high compared to other apps, even Chrome uses much less memory. The graphics seem to be the main part, but also native code (Doodle does not use any native lib?).

How can the memory usage be reduced?

Screenshot 2022-02-18 175528

@patzly patzly added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed and removed good first issue Good for newcomers labels Feb 18, 2022
@coxackie
Copy link

how can the graphics take up so much memory when they are svg though?

@patzly
Copy link
Owner Author

patzly commented Mar 15, 2022

@coxackie the compact svgs paths are not the problem, the problem are only the bitmaps. Some wallpapers (eg all of the leaked Pixel 6 collection) contain beside the svg shapes a minimum of 1 object with a complex texture/photo, so this can't be stored as svg paths but has to be included as bitmaps. I have done this with base64 bitmap encoding which is a valid concept in svgs but this makes them really large, about 1000-2000kb for each (and then a separate light and dark version). Even the text editors cannot really display those long base64 lines with thousands of characters...
The problem is that I can't compress them with jpg, because they need an alpha/transparency channel so it has to be lossless png. The only option is to scale them down, but I tried that and noticed that the lower quality when scaled up (eg on tablets) is very noticable.

@coxackie
Copy link

@patzly have you tried to monitor the memory for the svg walls? I am using pixel4 walls, and I see (from developer options) an average memory of ~240MB. This is not as high as ~385MB that you have, but I do not know whether the measurements are comparable. I would still say that ~240MB is quite a lot, but maybe there are bitmap components also in pixel4 walls?

@patzly
Copy link
Owner Author

patzly commented Mar 18, 2022

@coxackie No, there aren't any bitmaps in the Pixel 4 walls despite the third one with textures (codename Johanna). The weird thing is that the memory usage of the app is high (not as high as on the screenshot but higher than normal apps) without even setting the wallpaper... But it jumps to 380mb as soon as the wallpaper is being set, no matter which design is selected...
I've read that graphic shaders (which probably render the bitmaps) are using much memory, but I haven't any clue why this also happens when only a Pixel 4 design (only very simple paths and simple fill colors) is running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Backlog
Development

No branches or pull requests

2 participants