X
Tap here to go to the mobile version of the site.

Support Forum

localStorage reach maximum size while there are only 800 Kb data in it.

Posted

I met an localStorage exception when I call API "localStorage.setItem()"

we are developing a web site, we used host like aaaa.bb.com the case is :
the local storage has about 560KB Data in localstorage and then I want to set an item into localStorage, the size of the new item is 301KB
then the browser throw exception, the content of the exception is as follows:

The way I used to test the size of localStorage is: JSON.stringify(localStorage).length

"Persistent Storage maximum size reached" code:"1014" nsresult: "0x80530f6(NS_ERROR_DOM_QUOTA_REACHED)"

I tested this function in other machines and in chrome, this exception will not occur, I want to know why this exception occurs on the machine, if there is any settings in firefox? or if there is any relationship with the cache size?

I met an localStorage exception when I call API "localStorage.setItem()"<br> we are developing a web site, we used host like aaaa.bb.com the case is :<br> the local storage has about 560KB Data in localstorage and then I want to set an item into localStorage, the size of the new item is 301KB<br> then the browser throw exception, the content of the exception is as follows:<br> <br> The way I used to test the size of localStorage is: JSON.stringify(localStorage).length<br> <br> "Persistent Storage maximum size reached" code:"1014" nsresult: "0x80530f6(NS_ERROR_DOM_QUOTA_REACHED)"<br><br> I tested this function in other machines and in chrome, this exception will not occur, I want to know why this exception occurs on the machine, if there is any settings in firefox? or if there is any relationship with the cache size?

Chosen solution

the root cause is found.

the reason is that aaa.domain.com and bbb.domain.com, the two sub domain will share the same space of localStorage because they are under the same top level domain domain.com.

aaa.domain.com reach maximum size when there is only 500KB data in localStorage because there is already 4.5MB data in localStorage of bbb.domain.com.

Read this answer in context 4

Additional System Details

Installed Plug-ins

  • Shockwave Flash 11.6 r602
  • Adobe PDF Plug-In For Firefox and Netscape 11.0.02
  • 5.1.20125.0
  • DBank Plug-In For Firefox
  • iTunes Detector Plug-in
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Adobe Shockwave for Director Netscape plug-in, version 11.5.9.615

Application

  • User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0

More Information

{"libraryVersions": {"NSSSMIME": {"minVersion": "3.13.6.0 Basic ECC", "version": "3.13.6.0 Basic ECC"}, "NSSUTIL": {"minVersion": "3.13.6.0", "version": "3.13.6.0"}, "NSS": {"minVersion": "3.13.6.0 Basic ECC", "version": "3.13.6.0 Basic ECC"}, "NSSSSL": {"minVersion": "3.13.6.0 Basic ECC", "version": "3.13.6.0 Basic ECC"}, "NSPR": {"minVersion": "4.9.2", "version": "4.9.2"}}, "javaScript": {"incrementalGCEnabled": true}, "accessibility": {"forceDisabled": 0, "isActive": false}, "application": {"userAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0", "supportURL": "http://support.mozilla.org/1/firefox/17.0.2/WINNT/en-US/", "version": "17.0.2", "name": "Firefox"}, "modifiedPreferences": {"security.warn_viewing_mixed": false, "browser.display.background_color": "#C0C0C0", "network.cookie.prefsMigrated": true, "browser.cache.disk.capacity": 1048576, "browser.startup.homepage_override.buildID": "20130107124423", "browser.cache.disk.smart_size.first_run": false, "places.database.lastMaintenance": 1372042911, "accessibility.typeaheadfind.flashBar": 0, "places.history.expiration.transient_current_max_pages": 104858, "browser.places.smartBookmarksVersion": 4, "dom.disable_open_during_load": false, "browser.cache.disk.smart_size.enabled": false, "extensions.lastAppVersion": "17.0.2", "browser.cache.disk.smart_size_cached_value": 962560, "gfx.direct3d.prefer_10_1": true, "browser.cache.disk.smart_size.use_old_max": false, "browser.startup.homepage": "http://i2home/default.aspx", "privacy.sanitize.migrateFx3Prefs": true, "browser.startup.homepage_override.mstone": "17.0.2", "font.internaluseonly.changed": true, "browser.display.use_system_colors": true}, "extensions": [{"version": "1.1.0.2", "name": "DBankPlugin", "isActive": true, "id": "HighSpeedDownload@dbank.com"}, {"version": "5.4", "name": "Evernote Web Clipper", "isActive": true, "id": "{E0B8C461-F8FB-49b4-8373-FE32E9252800}"}, {"version": "1.9.2", "name": "Firebug", "isActive": true, "id": "firebug@software.joehewitt.com"}, {"version": "1.1a", "name": "Troubleshooter", "isActive": true, "id": "troubleshooter@mozilla.org"}, {"version": "2.04.20110724", "name": "IE Tab +", "isActive": false, "id": "coralietab@mozdev.org"}, {"version": "11.3.0.9 - 5", "name": "Symantec Vulnerability Protection", "isActive": false, "id": "{BBDA0591-3099-440a-AA10-41764D9DB4DB}"}], "graphics": "Troubleshoot data provider failed: graphics\nTypeError: ext is null", "userJS": {"exists": false}}

Chosen Solution

the root cause is found.

the reason is that aaa.domain.com and bbb.domain.com, the two sub domain will share the same space of localStorage because they are under the same top level domain domain.com.

aaa.domain.com reach maximum size when there is only 500KB data in localStorage because there is already 4.5MB data in localStorage of bbb.domain.com.

the root cause is found. the reason is that aaa.domain.com and bbb.domain.com, the two sub domain will share the same space of localStorage because they are under the same top level domain domain.com. aaa.domain.com reach maximum size when there is only 500KB data in localStorage because there is already 4.5MB data in localStorage of bbb.domain.com.