Too much storage in IndexedDB using GunDB

326 Views Asked by At

I try to synchronize VR scene using GunDB.

In order to experiment it, I put a few data in GunDB.

But I got this warning. storage warning

I use IndexedDB, and I can keep going it with hitting 'allow'

But I'm wondering why it uses too much storage!!!!!

setInterval(putLocation, Math.ceil(1000 / 50));

// putLocation
obj.get('attributes').get('position').put(object.attributes.position);

It updates data every 200ms in the same node. (object.attributes.position)

please let me know how could I fix it. Thank you.

2

There are 2 best solutions below

0
marknadal On

@huhsame 1.2GB for VR scene data? That seems suspicious.

By chance is this in Safari?

Safari has a known bug (@go1dfish found this) where it creates run-away storage accumulation (with or without gunDB) that gets triggered if its file descriptor is left open too long.

Could you see if the same thing happens in Chrome? If it does, it is a GUN bug then.

If it is just Safari, we tried to add code that would reset/reopen Safari's IndexedDB instance every 15 seconds, and have had success so far with that approach.

However, clearly, either Safari has changed something, or that workaround is no longer viable, so we'll need to figure something new out.

I understand Safari is very important because of iOS, it is just unfortunate that Safari lags behind on several very serious and important fronts (WebRTC, IndexedDB, & WebM). There is only so much our team can do to work around these bugs until Safari is more standards compliant. But where we can workaround, we will.

0
huhsame On

@marknadal

thanks for your answer. and sorry I am late. I tested it on Chrome and Safari after clearing storage. after 30 minutes, Chrome used about 1MB, and on the Safari, I did not find the usage panel but there is no pop-up for warning like the previous one.

I guess it was total data since September when I had started this experiment. but it's just my opinion. And I am still wondering that users should delete data in WebStorage regularly?

please answer me.