diff options
author | Michael Dawson <michael_dawson@ca.ibm.com> | 2016-04-14 18:34:00 -0400 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2016-06-29 09:06:15 +0200 |
commit | b88dee2768d605e97882b8997ddc518148e638a0 (patch) | |
tree | b0ecd8954faeab90db87929d3dcdbf8176266b93 /deps/v8/src/heap | |
parent | 2cc29517966de7257a2f1b34c58c77225a21e05d (diff) | |
download | android-node-v8-b88dee2768d605e97882b8997ddc518148e638a0.tar.gz android-node-v8-b88dee2768d605e97882b8997ddc518148e638a0.tar.bz2 android-node-v8-b88dee2768d605e97882b8997ddc518148e638a0.zip |
deps: cherry-pick 1ef7487b from v8 upstream
Original commit message:
Improved diagnostic message for JS heap out of memory
This patch replaces the unused 'take_snapshot' parameter on
FatalProcessOutOfMemory() with a 'is_heap_oom' parameter.
The parameter is set to true on error paths where the
JS heap is out of memory, as distinct from a malloc()
failure i.e. process out of memory. The message output to
stderr or passed to embedding applications via FatalErrorCallback
is 'Javascript heap out of memory' rather than
'process out of memory'.
BUG=
R=jochen@chromium.org, verwaest@chromium.org, michael_dawson@ca.ibm.com
Review URL: https://codereview.chromium.org/1873443002
Cr-Commit-Position: refs/heads/master@{#35431}
We'd like this in 6.x to help with diagnosing customer problems.
It provides a better message on OOM so that it is easier to
be able to tell whether the OOM was due to heap exhaustion
or running out of native memory.
PR-URL: https://github.com/nodejs/node/pull/6218
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/v8/src/heap')
-rw-r--r-- | deps/v8/src/heap/heap.cc | 8 | ||||
-rw-r--r-- | deps/v8/src/heap/heap.h | 2 | ||||
-rw-r--r-- | deps/v8/src/heap/mark-compact.cc | 4 |
3 files changed, 6 insertions, 8 deletions
diff --git a/deps/v8/src/heap/heap.cc b/deps/v8/src/heap/heap.cc index c3f56ac4c5..2b5ff9cd1a 100644 --- a/deps/v8/src/heap/heap.cc +++ b/deps/v8/src/heap/heap.cc @@ -4018,8 +4018,7 @@ AllocationResult Heap::AllocateUninitializedFixedDoubleArray( AllocationResult Heap::AllocateRawFixedDoubleArray(int length, PretenureFlag pretenure) { if (length < 0 || length > FixedDoubleArray::kMaxLength) { - v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", - kDoubleAligned); + v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true); } int size = FixedDoubleArray::SizeFor(length); AllocationSpace space = SelectSpace(pretenure); @@ -5648,9 +5647,8 @@ void Heap::CompactRetainedMaps(ArrayList* retained_maps) { if (new_length != length) retained_maps->SetLength(new_length); } - -void Heap::FatalProcessOutOfMemory(const char* location, bool take_snapshot) { - v8::internal::V8::FatalProcessOutOfMemory(location, take_snapshot); +void Heap::FatalProcessOutOfMemory(const char* location, bool is_heap_oom) { + v8::internal::V8::FatalProcessOutOfMemory(location, is_heap_oom); } #ifdef DEBUG diff --git a/deps/v8/src/heap/heap.h b/deps/v8/src/heap/heap.h index 9457453561..77c10b24d2 100644 --- a/deps/v8/src/heap/heap.h +++ b/deps/v8/src/heap/heap.h @@ -568,7 +568,7 @@ class Heap { static inline bool IsOneByte(T t, int chars); static void FatalProcessOutOfMemory(const char* location, - bool take_snapshot = false); + bool is_heap_oom = false); static bool RootIsImmortalImmovable(int root_index); diff --git a/deps/v8/src/heap/mark-compact.cc b/deps/v8/src/heap/mark-compact.cc index 5ffea25488..de40fa0519 100644 --- a/deps/v8/src/heap/mark-compact.cc +++ b/deps/v8/src/heap/mark-compact.cc @@ -1728,8 +1728,8 @@ class MarkCompactCollector::EvacuateNewSpaceVisitor final compaction_spaces_->Get(OLD_SPACE)->AllocateRaw(size_in_bytes, alignment); if (allocation.IsRetry()) { - FatalProcessOutOfMemory( - "MarkCompactCollector: semi-space copy, fallback in old gen\n"); + v8::internal::Heap::FatalProcessOutOfMemory( + "MarkCompactCollector: semi-space copy, fallback in old gen", true); } return allocation; } |