Should behave like MemoryPressureHandler::releaseMemory @ MemoryPressureHandlerMac.mm. + WebCore::StorageThread::releaseFastMallocFreeMemoryInAllThreads(); +#if ENABLE(WORKERS) + WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads(); +#endif + WTF::releaseFastMallocFreeMemory();
WTF's FastMalloc(TCMalloc) logic implements memory management which is optimized for faster allocation and release. FastMalloc maintains free-list for each thread and one central list per process to avoid semaphore locking overhead(lock contention). Periodically thread specific free blocks will be moved to central free-list then it will be released back to system using special thread named "scavenger". Incase of memory pressure free-blocks scattered around threads should be released back to OS, so that other processes can use the memory. So modifying QWebSettings::clearMemoryCaches to call FastMalloc's page release functions. I will upload the patch soon.
Created attachment 192045 [details] Patch
Created attachment 192046 [details] #include <wtf/Functional.h> inclusion is not needed
Comment on attachment 192046 [details] #include <wtf/Functional.h> inclusion is not needed r=me
Comment on attachment 192046 [details] #include <wtf/Functional.h> inclusion is not needed Clearing flags on attachment: 192046 Committed r145211: <http://trac.webkit.org/changeset/145211>
All reviewed patches have been landed. Closing bug.