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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3375 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
kasperl@chromium.org 2009-11-30 07:57:32 +00:00
parent 6d163d9fd0
commit 402e356e82

View File

@ -2901,6 +2901,11 @@ bool Heap::IdleNotification() {
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_;