Reviewers: ulan,
Description:
Merge r10466 from the bleeding_edge to the 3.6 branch.
Limit number of loop iterations in Heap::ReserveSpace.
This allows to avoid infinite loops in pathalogical cases e.g. when OS
refuses
to give new pages to V8.
[email protected]
BUG=99027
Review URL: https://chromiumcodereview.appspot.com/8286020
------------------------------------------------------------------------
Please review this at https://chromiumcodereview.appspot.com/9138028/
SVN Base: http://v8.googlecode.com/svn/branches/3.6/
Affected files:
M src/heap.cc
M src/version.cc
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 10466)
+++ src/heap.cc (working copy)
@@ -563,7 +563,9 @@
PagedSpace* cell_space = Heap::cell_space();
LargeObjectSpace* lo_space = Heap::lo_space();
bool gc_performed = true;
- while (gc_performed) {
+ int counter = 0;
+ static const int kThreshold = 20;
+ while (gc_performed && counter++ < kThreshold) {
gc_performed = false;
if (!new_space->ReserveSpace(new_space_size)) {
Heap::CollectGarbage(NEW_SPACE);
@@ -602,6 +604,11 @@
gc_performed = true;
}
}
+
+ if (gc_performed) {
+ // Failed to reserve the space after several attempts.
+ V8::FatalProcessOutOfMemory("Heap::ReserveSpace");
+ }
}
Index: src/version.cc
===================================================================
--- src/version.cc (revision 10466)
+++ src/version.cc (working copy)
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 6
#define BUILD_NUMBER 6
-#define PATCH_LEVEL 19
+#define PATCH_LEVEL 20
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev