summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-02 18:35:00 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-02 18:35:00 +0000
commitadf00bca79988a0363e45c14a9f9604b218930ca (patch)
tree38e6beb9eb06c776b42dc433a9c203b44529577e
parentbd06e0146a5ad4ae79671e1d4e778627da985fd2 (diff)
downloadchromium_src-adf00bca79988a0363e45c14a9f9604b218930ca.zip
chromium_src-adf00bca79988a0363e45c14a9f9604b218930ca.tar.gz
chromium_src-adf00bca79988a0363e45c14a9f9604b218930ca.tar.bz2
Purge memory for DBs in the renderer process.
BUG=23400 TEST=none Review URL: http://codereview.chromium.org/350012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30723 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/render_thread.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index bd2d07a..9790d6d 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -8,6 +8,12 @@
#include <map>
#include <vector>
+#if defined(USE_SYSTEM_SQLITE)
+#include <sqlite3.h>
+#else
+#include "third_party/sqlite/preprocessed/sqlite3.h"
+#endif
+
#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
@@ -47,14 +53,14 @@
#include "chrome/renderer/socket_stream_dispatcher.h"
#include "chrome/renderer/user_script_slave.h"
#include "ipc/ipc_message.h"
+#include "third_party/tcmalloc/tcmalloc/src/google/malloc_extension.h"
#include "webkit/api/public/WebCache.h"
#include "webkit/api/public/WebColor.h"
#include "webkit/api/public/WebCrossOriginPreflightResultCache.h"
-#include "webkit/api/public/WebRuntimeFeatures.h"
-#include "webkit/api/public/WebFontCache.h"
-#include "webkit/api/public/WebColor.h"
#include "webkit/api/public/WebDatabase.h"
+#include "webkit/api/public/WebFontCache.h"
#include "webkit/api/public/WebKit.h"
+#include "webkit/api/public/WebRuntimeFeatures.h"
#include "webkit/api/public/WebScriptController.h"
#include "webkit/api/public/WebSecurityPolicy.h"
#include "webkit/api/public/WebStorageEventDispatcher.h"
@@ -63,7 +69,6 @@
#include "webkit/extensions/v8/gears_extension.h"
#include "webkit/extensions/v8/interval_extension.h"
#include "webkit/extensions/v8/playback_extension.h"
-#include "third_party/tcmalloc/tcmalloc/src/google/malloc_extension.h"
#if defined(OS_WIN)
#include <windows.h>
@@ -72,8 +77,8 @@
using WebKit::WebCache;
using WebKit::WebCrossOriginPreflightResultCache;
-using WebKit::WebRuntimeFeatures;
using WebKit::WebFontCache;
+using WebKit::WebRuntimeFeatures;
using WebKit::WebSecurityPolicy;
using WebKit::WebScriptController;
using WebKit::WebString;
@@ -583,6 +588,11 @@ void RenderThread::OnPurgeMemory() {
// Clear the Cross-Origin Preflight cache.
WebCrossOriginPreflightResultCache::clear();
+ // Release all freeable memory from the SQLite process-global page cache (a
+ // low-level object which backs the Connection-specific page caches).
+ while (sqlite3_release_memory(std::numeric_limits<int>::max()) > 0)
+ ;
+
// Repeatedly call the V8 idle notification until it returns true ("nothing
// more to free"). Note that it makes more sense to do this than to implement
// a new "delete everything" pass because object references make it difficult