Revision: 3375
Author: [email protected]
Date: Sun Nov 29 23:57:32 2009
Log: Clear the compilation cache just before starting to do mark-sweep
garbage collections when receiving idle notifications. This allows
us to get rid of source code strings and generated code in the
heap that would otherwise be kept around in idle V8 instances.
Review URL: http://codereview.chromium.org/450007
http://code.google.com/p/v8/source/detail?r=3375

Modified:
  /branches/bleeding_edge/src/heap.cc

=======================================
--- /branches/bleeding_edge/src/heap.cc Tue Nov 24 06:10:06 2009
+++ /branches/bleeding_edge/src/heap.cc Sun Nov 29 23:57:32 2009
@@ -2901,6 +2901,11 @@
      last_gc_count = gc_count_;

    } else if (number_idle_notifications == kIdlesBeforeMarkSweep) {
+    // Before doing the mark-sweep collections we clear the
+    // compilation cache to avoid hanging on to source code and
+    // generated code for cached functions.
+    CompilationCache::Clear();
+
      CollectAllGarbage(false);
      new_space_.Shrink();
      last_gc_count = gc_count_;

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to