Fix lazy sweeping heuristics to prevent old-space expansion.
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
This commit is contained in:
parent
47be3e8231
commit
776493ab42
@ -3823,12 +3823,6 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
|
|||||||
bool lazy_sweeping_active = false;
|
bool lazy_sweeping_active = false;
|
||||||
bool unused_page_present = 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()) {
|
while (it.has_next()) {
|
||||||
Page* p = it.next();
|
Page* p = it.next();
|
||||||
|
|
||||||
@ -3888,7 +3882,7 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
|
|||||||
}
|
}
|
||||||
freed_bytes += SweepConservatively(space, p);
|
freed_bytes += SweepConservatively(space, p);
|
||||||
pages_swept++;
|
pages_swept++;
|
||||||
if (space_left + freed_bytes > newspace_size) {
|
if (freed_bytes > 2 * newspace_size) {
|
||||||
space->SetPagesToSweep(p->next_page());
|
space->SetPagesToSweep(p->next_page());
|
||||||
lazy_sweeping_active = true;
|
lazy_sweeping_active = true;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user