Questions about the quota of IDBDevice on CheerpX
Hello there. I am planning to use
Cheerpx
to create an online Android ROM processing tool.
While trying webvm.io
, I noticed that the max size of the filesystem is limited to 2GiB
, as Disk
category says. Here is the result of executing df -h
:
However, I believed that on Chromium or Edge browsers, the max quota of IndexedDB is set to nearly 80% of the user storage, which is way larger than 2GiB (on my PC its ~307 GiB
, inferring from await navigator.storage.estimate()
). I know the limit is because of Firefox's restrictions but I am currently using Edge.
I am sure that if I can use the rest of the spaces, I may be able to perform as many actions as usual Linux does, however 2GiB
is way to small.
I wonder if there is any option on the constructor of IDBDevice
to bypass this limit on Chromium based browsers. If no, I want to know if there is any workaround.
Just in case, I am unable to figure out solutions myself since CheerpX
is closed source and obfuscated.
Thank you very much.4 Replies
Hi, thanks for getting in touch. There is no actual limit on the indexedDB backend. Those numbers are just placeholders. The 2GB limit does apply to ext2 images though
Please be aware that we cannot guarantee any specific amount of storage on IDB, since as you correctly pointed out it's controlled by the browser
Thanks for answering. However this seems a little tricky. It would be great if I could customize the quota (or simply "display size" in
df
) of the disk via constructor or something like .setSize()
, as some programs may check the rest space of the filesystem during execution (e.g. pacman
), which may cause unexpected issues.
Adding such options may also benefit non-Chromium based browsers, because:
1. Exception throws when we exceed the quota limit.
2. We are not able to handle the exception perfectly when that happens, since the internal state of vm is completely messed somehow.
Explicitly declared sizes could turn out of space
exceptions into a soft system failure (ENOSPC
errno) in VM, so the project is more robust.
May I request the feature? Thanks a lot again.
If necessary, I may open another thread or a GitHub issue for this feature.@Jules please consider this feature request and add a task in the internal bug tracker. @熊谷 凌 (FurryR) we cannot unfortunately commit to implementing this right away, especially since we are deeply restructuring how indexedDB is used in our products. My recommendation would be to see if you encounter actual problems with the current level of support
As a workaround you might be able to split your files into multiple mount points
No problem. Thank you!
By the way, if you are going to add this feature in todo task, please also consider adding a method to speculate used size and total size of current IDB filesystem instance (in Javascript) as well. ❤️
Oh, one last request, I believe that DataDevice also need such options and methods as we could measure heap size via
performance.memory
. A lot of thanks.