Index: test/cctest/test-heap.cc |
=================================================================== |
--- test/cctest/test-heap.cc (revision 12497) |
+++ test/cctest/test-heap.cc (working copy) |
@@ -1244,7 +1244,9 @@ |
for (HeapObject* obj = iterator.next(); |
obj != NULL; |
obj = iterator.next()) { |
- size_of_objects_2 += obj->Size(); |
+ if (!obj->IsFreeSpace()) { |
+ size_of_objects_2 += obj->Size(); |
+ } |
} |
// Delta must be within 5% of the larger result. |
// TODO(gc): Tighten this up by distinguishing between byte |
@@ -1273,7 +1275,6 @@ |
// that the scavenger does not undo the filling. |
v8::HandleScope scope; |
AlwaysAllocateScope always_allocate; |
- LinearAllocationScope allocate_linearly; |
intptr_t available = new_space->EffectiveCapacity() - new_space->Size(); |
intptr_t number_of_fillers = (available / FixedArray::SizeFor(32)) - 1; |
for (intptr_t i = 0; i < number_of_fillers; i++) { |
@@ -1928,8 +1929,13 @@ |
HEAP->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 2"); |
CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages() * 2); |
- // Triggering a last-resort GC should cause all pages to be released |
- // to the OS so that other processes can seize the memory. |
+ // Triggering a last-resort GC should cause all pages to be released to the |
+ // OS so that other processes can seize the memory. If we get a failure here |
+ // where there are 2 pages left instead of 1, then we should increase the |
+ // size of the first page a little in SizeOfFirstPage in spaces.cc. The |
+ // first page should be small in order to reduce memory used when the VM |
+ // boots, but if the 20 small arrays don't fit on the first page then that's |
+ // an indication that it is too small. |
HEAP->CollectAllAvailableGarbage("triggered really hard"); |
CHECK_EQ(1, old_pointer_space->CountTotalPages()); |
} |