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

Unified Diff: Source/wtf/Partitions.cpp

Issue 1155293007: Expose ReleaseFreeMemory to free up memory on memory pressure or idle cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: made changes. Created 5 years, 7 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
Index: Source/wtf/Partitions.cpp
diff --git a/Source/wtf/Partitions.cpp b/Source/wtf/Partitions.cpp
index 4eba302cc10cb0a1a53ae5be0717046b9547b9e8..d74756ef63764f0efe33b569075f0cee3081301a 100644
--- a/Source/wtf/Partitions.cpp
+++ b/Source/wtf/Partitions.cpp
@@ -72,6 +72,22 @@ void Partitions::shutdown()
(void) m_fastMallocAllocator.shutdown();
}
+void Partitions::releaseFreeMemory()
+{
+ ASSERT(isMainThread());
+
+ spinLockLock(&getBufferPartition()->lock);
haraken 2015/06/03 11:39:00 Can we move this lock into partitionPurgeMemory?
ssid 2015/06/03 11:45:31 1. PartitionRootBase is a struct and partitionPurg
+ partitionPurgeMemory(getBufferPartition());
+ spinLockUnlock(&getBufferPartition()->lock);
+
+ spinLockLock(&getFastMallocPartition()->lock);
+ partitionPurgeMemory(getFastMallocPartition());
+ spinLockUnlock(&getFastMallocPartition()->lock);
+
+ partitionPurgeMemory(getObjectModelPartition());
+ partitionPurgeMemory(getRenderingPartition());
+}
+
void Partitions::reportMemoryUsageHistogram()
{
static size_t supportedMaxSizeInMB = 4 * 1024;
« no previous file with comments | « Source/wtf/Partitions.h ('k') | public/web/WebKit.h » ('j') | public/web/WebKit.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698