[heap] print useful message when heap init fails.

R=ulan@chromium.org

This is in response to

https: //github.com/nodejs/node/issues/16901
Change-Id: I78fd5ea5b1d5602c4e48b985189e1b4114ff6443
Reviewed-on: https://chromium-review.googlesource.com/758680
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49340}
This commit is contained in:
Yang Guo 2017-11-09 17:04:28 +01:00 committed by Commit Bot
parent 88a2b1ee98
commit 8b54fec88f

View File

@ -1469,6 +1469,11 @@ bool Heap::ReserveSpace(Reservation* reservations, std::vector<Address>* maps) {
}
}
if (perform_gc) {
// We cannot perfom a GC with an uninitialized isolate. This check
// fails for example if the max old space size is chosen unwisely,
// so that we cannot allocate space to deserialize the initial heap.
CHECK_WITH_MSG(deserialization_complete_,
"insufficient memory to create an Isolate");
if (space == NEW_SPACE) {
CollectGarbage(NEW_SPACE, GarbageCollectionReason::kDeserializer);
} else {