Comments (5)
Dumping the prettyfied XML structure seems to clock in at around 18MB. This does not seem that much for the database itself objectively but it seems this is already too much, as autofill just dies silently.
I agree, such an XML this should not be too big of a deal. Dying silently means running out of memory at XML parsing or processing stage.
As much as I would love to skip custom icons and attachments while loading in AutoFill, this is quite problematic. Due to an early design mistake, KeePassium uses a DOM parser (which loads the whole XML tree to memory), rather than an event-based SAX parser (which parses XML in small chunks and can make decisions during the process). To my defense, at the time of this decision AutoFill was not even announced, so memory consumption was not that important.
Well, now memory became important, but optimization requires rewriting the whole database processing code. Which is a large all-or-nothing task that cannot be done incrementally. It is indeed on the list, but there is always something more urgent…
</rant>
there are some 300+kB favicons in there which is ridiculous.
This might be the reason.
When adding larger favicons, KeePassium specifically downsizes them to 128x128 PNG. But when showing the existing ones, resizing is done only in UI. Which means, according to this post, that the original image, in full resolution and colors, is decompressed to memory for displaying. I guess a 300 kB compressed PNG turns into quite a heavy bitmap…
(By the way, were the large favicons added by KeePassium? If so, there is probably a separate issue in the downsizing code.)
from keepassium.
I agree, such an XML this should not be too big of a deal. Dying silently means running out of memory at XML parsing or processing stage.
Thank you for confirming. This was my understanding as well.
As much as I would love to skip custom icons and attachments while loading in AutoFill, this is quite problematic. Due to an early design mistake, KeePassium uses a DOM parser (which loads the whole XML tree to memory), rather than an event-based SAX parser (which parses XML in small chunks and can make decisions during the process). To my defense, at the time of this decision AutoFill was not even announced, so memory consumption was not that important.
Right. DOM Parser seems like a sensible choice. If there were no memory pressure. Which there now unfortunately is. Bummer.
Well, now memory became important, but optimization requires rewriting the whole database processing code. Which is a large all-or-nothing task that cannot be done incrementally. It is indeed on the list, but there is always something more urgent…
Of course. But hey, easter is coming up, what better time to relax, ponder past sins and rewrite such code?! 😆
there are some 300+kB favicons in there which is ridiculous.
This might be the reason.
When adding larger favicons, KeePassium specifically downsizes them to 128x128 PNG. But when showing the existing ones, resizing is done only in UI. Which means, according to this post, that the original image, in full resolution and colors, is decompressed to memory for displaying. I guess a 300 kB compressed PNG turns into quite a heavy bitmap…
Interesting. Just read that post and if that's the case that would indeed explain the problem I'm seeing.
(By the way, were the large favicons added by KeePassium? If so, there is probably a separate issue in the downsizing code.)
I am not certain. I've been using KeepassXC and KeePassium in parallel and do not remember exactly, which icons were added where.
When I was looking for testcases for large icons in my database, I noticed a weird thing though:
The large icons in my db are all icons with 384 x 384px resolution.
But the source websites only offer smaller icons:
- https://www.wago.com/ - Their apple touch icon is only 180x180px: https://www.wago.com/_ui/static_2024-03-20_09-58/desktop/common/images/apple-touch-icon.png
- https://www.elektroradar.de/ - Their largest touch icon is 144px.
So it looks like something is actually saving the icons in a larger format than needed? Could that someone be KeePassium?
from keepassium.
Could that someone be KeePassium?
Guess what, you are absolutely right! KeePassium successfully "downscales" 180x180px icons into 128x128pt, which happens to be 384x384px on modern devices :) I've created a separate issue for that: #354
from keepassium.
Of course. But hey, easter is coming up, what better time to relax, ponder past sins and rewrite such code?! 😆
See, there is always something smaller and more urgent :)
from keepassium.
See, there is always something smaller and more urgent :)
🤯
I wiped the 384x384px icons from the database.
Database is now back down to about 1MB and Autofill is not dying anymore with that size.
So I guess this is a win? 😆
Of course, the overall problem is still unsolved, autofill should not be dying over icons...
from keepassium.
Related Issues (20)
- Password quality meter is too optimistic for the estimated entropy
- Password Generator separator breaks ui HOT 5
- TOTP autofill? HOT 2
- Password does not hide correctly after locking iPhone HOT 1
- Allow showing Tags in Entry Subtitle HOT 4
- Option for keeping the window open during new entry HOT 2
- Entry title missing on iPad's right panel
- Cannot use different WebDAV credentials for the same host HOT 2
- Entry tags disappear after OTP setup.
- MEGA.nz Files app integration HOT 7
- macOS: TouchID prompt not in Focus HOT 1
- password protection for each field? HOT 3
- iOS Autofilling memory insufficient workaround HOT 1
- Download database file only if it has changed since last sync HOT 1
- Cant fill in any password in Safari HOT 2
- Selectable path for backup files HOT 3
- MacOS/Safari: Autofill works without TouchID and TouchID-windows still appears HOT 3
- Dropbox API connection fails with error -1005 "Network connection was lost"
- MacOS Webdav not longer working HOT 12
- Keepassium 1.53.152 crashes when trying to search HOT 3
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 keepassium.