I am using pouchDB
with IndexedDB
adapter on chrome browser and I want to calculate the each IndexedDB database size. I use the code from https://github.com/jonnysmith1981/getIndexedDbSize/blob/master/getIndexedDbSize.js to do the calculation.
What I found is that the total size of the databases is far greater than the webkit temporary storage usage.
Below screenshot is the total storage (255MB) used by my application.
You will see there are 5 databases saved in IndexedDB
. And below output is the calculation result for the size of each database. You will see that the total size is about 389MB. I wonder why they are quite different. Which one is the correct one?
--------- _pouch_products -------------
VM1633:51 - attach-seq-store : 0 B
VM1633:51 - attach-store : 0 B
VM1633:51 - by-sequence : 86.7 MB
VM1633:51 - detect-blob-support : 2 B
VM1633:51 - document-store : 92.3 MB
VM1633:51 - local-store : 6.1 KB
VM1633:51 - meta-store : 96 B
VM1633:57 TOTAL: 179.0 MB
--------- _pouch_transactions -------------
VM1633:51 - attach-seq-store : 0 B
VM1633:51 - attach-store : 0 B
VM1633:51 - by-sequence : 13.7 KB
VM1633:51 - detect-blob-support : 2 B
VM1633:51 - document-store : 2.2 KB
VM1633:51 - local-store : 4.2 KB
VM1633:51 - meta-store : 96 B
VM1633:57 TOTAL: 20.2 KB
--------- _pouch_products-mrview-4c294f20854f412a71c9e7cf2f9cc58f -------------
VM1633:51 - attach-seq-store : 0 B
VM1633:51 - attach-store : 0 B
VM1633:51 - by-sequence : 11.9 MB
VM1633:51 - detect-blob-support : 0 B
VM1633:51 - document-store : 35.3 MB
VM1633:51 - local-store : 15.1 MB
VM1633:51 - meta-store : 136 B
VM1633:57 TOTAL: 62.3 MB
--------- _pouch_products-mrview-fdca57d512425c6ed0f20311a4f8d6d1 -------------
VM1633:51 - attach-seq-store : 0 B
VM1633:51 - attach-store : 0 B
VM1633:51 - by-sequence : 86.2 MB
VM1633:51 - detect-blob-support : 0 B
VM1633:51 - document-store : 44.2 MB
VM1633:51 - local-store : 17.4 MB
VM1633:51 - meta-store : 136 B
VM1633:57 TOTAL: 147.7 MB
--------- _product_alerts -------------
VM1633:57 TOTAL: 0 B