【发布时间】:2019-04-06 04:41:10
【问题描述】:
我在 chrome 浏览器上使用 pouchDB 和 IndexedDB 适配器,我想计算每个 IndexedDB 数据库的大小。我使用来自https://github.com/jonnysmith1981/getIndexedDbSize/blob/master/getIndexedDbSize.js 的代码进行计算。
我发现数据库的总大小远远大于 webkit 临时存储的使用量。
下面的屏幕截图是我的应用程序使用的总存储空间 (255MB)。
您会看到IndexedDB 中保存了5 个数据库。下面的输出是每个数据库大小的计算结果。您将看到总大小约为 389MB。我想知道为什么它们完全不同。哪一个是正确的?
--------- _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
【问题讨论】:
标签: javascript google-chrome indexeddb pouchdb