Commit 8b54fec8 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[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/758680Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49340}
parent 88a2b1ee
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment