Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: chrome/renderer/render_thread.cc

Issue 350012: Purge memory for DBs in the renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_thread.cc
===================================================================
--- chrome/renderer/render_thread.cc (revision 30634)
+++ chrome/renderer/render_thread.cc (working copy)
@@ -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/WebDatabase.h"
#include "webkit/api/public/WebFontCache.h"
-#include "webkit/api/public/WebColor.h"
-#include "webkit/api/public/WebDatabase.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::WebFontCache;
using WebKit::WebRuntimeFeatures;
-using WebKit::WebFontCache;
using WebKit::WebSecurityPolicy;
using WebKit::WebScriptController;
using WebKit::WebString;
@@ -577,6 +582,11 @@
// 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)
darin (slow to review) 2009/10/31 22:39:40 do we compile with -DSQLITE_ENABLE_MEMORY_MANAGEME
+ ;
+
// 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698