1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // MemoryPurger provides static APIs to purge as much memory as possible from
6 // all processes. These can be hooked to various signals to try and balance
7 // memory consumption, speed, page swapping, etc.
9 // This was implemented in an attempt to speed up suspend-to-disk by throwing
10 // away any cached data that can be recomputed. Memory use will rapidly
11 // re-expand after this purge is run.
13 #ifndef CHROME_BROWSER_MEMORY_PURGER_H_
14 #define CHROME_BROWSER_MEMORY_PURGER_H_
16 #include "base/basictypes.h"
19 class RenderProcessHost
;
24 // Call any of these on the UI thread to purge memory from the named places.
25 static void PurgeAll();
26 static void PurgeBrowser();
27 static void PurgeRenderers();
28 static void PurgeRendererForHost(content::RenderProcessHost
* host
);
31 DISALLOW_IMPLICIT_CONSTRUCTORS(MemoryPurger
);
34 #endif // CHROME_BROWSER_MEMORY_PURGER_H_