This is a temporary fix to prevent excessive expansion of old-space
caused by inaccuracies in lazy sweeper advancing. We actually don't
intend to sweep any pages eagerly, but that requires further changes
to lazy sweeping.
R=ulan@chromium.org,erik.corry@gmail.com
BUG=v8:2194
Review URL: https://chromiumcodereview.appspot.com/
10640002
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11904
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
bool lazy_sweeping_active = false;
bool unused_page_present = false;
- intptr_t old_space_size = heap()->PromotedSpaceSizeOfObjects();
- intptr_t space_left =
- Min(heap()->OldGenLimit(old_space_size, Heap::kMinPromotionLimit),
- heap()->OldGenLimit(old_space_size, Heap::kMinAllocationLimit)) -
- old_space_size;
-
while (it.has_next()) {
Page* p = it.next();
}
freed_bytes += SweepConservatively(space, p);
pages_swept++;
- if (space_left + freed_bytes > newspace_size) {
+ if (freed_bytes > 2 * newspace_size) {
space->SetPagesToSweep(p->next_page());
lazy_sweeping_active = true;
} else {