As per thread here: https://groups.google.com/a/chromium.org/forum/?nomobile=true#!topic/project-trim/akay4BZVxeU The current logic to purge storage memory use is more or less hardcoded to execute when the number of open areas is >100. We should tune this heuristic for different platforms and also make it use MemoryPressureListener
@Michael, could you take a look at this with the rest of the mojo-ification work you're looking at? It would be nice to get this fixed in the next quarter or two if possible!
this is about to land in the context of the existing impl https://codereview.chromium.org/1953703004/
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/454f3cefe1b33de5a422778e5cf09d6311bb7fa7 commit 454f3cefe1b33de5a422778e5cf09d6311bb7fa7 Author: ssid <ssid@chromium.org> Date: Mon May 23 21:33:48 2016 Purge browser cache for dom storage in a smarter way This CL does: 1. Use the total cache size to decide when to purge memory from in memory caches. 2. Use different limits on databases and cache sizes based on the platform and the ram available. 3. For low memory devices do not keep any cache around for closed databases (closed tabs). 4. Add a memory pressure listener to dom storage. This listener is supposed to construct and destruct in same thread. So, it is constructed and destructed on UI thread by DOMStorageContextWrapper and post tasks purge to the dom task runner. BUG= 610551 , 607449 Review-Url: https://codereview.chromium.org/1953703004 Cr-Commit-Position: refs/heads/master@{#395418} [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_area.h [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_context_impl.cc [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_context_impl.h [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_context_impl_unittest.cc [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_context_wrapper.cc [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_context_wrapper.h [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_database.cc [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_host.cc [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_namespace.cc [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/browser/dom_storage/dom_storage_namespace.h [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/content/common/dom_storage/dom_storage_types.h [modify] https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7/tools/metrics/histograms/histograms.xml
Some optimizations are left, tracked by bug 610551 .
Comment 1 by dk...@chromium.org
, May 16 2016