Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: src/api.cc

Issue 1873443002: Improved diagnostic message for JS heap out of memory (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 3e52cc0e6fd61cf0607644ae4cde52316685010e..27ac2622857651972da836082f43f56c39d9c404 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -241,7 +241,7 @@ void i::FatalProcessOutOfMemory(const char* location) {
// When V8 cannot allocated memory FatalProcessOutOfMemory is called.
// The default fatal error handler is called and execution is stopped.
-void i::V8::FatalProcessOutOfMemory(const char* location, bool take_snapshot) {
+void i::V8::FatalProcessOutOfMemory(const char* location, bool is_heap_oom) {
i::Isolate* isolate = i::Isolate::Current();
char last_few_messages[Heap::kTraceRingBufferSize + 1];
char js_stacktrace[Heap::kStacktraceBufferSize + 1];
@@ -303,7 +303,13 @@ void i::V8::FatalProcessOutOfMemory(const char* location, bool take_snapshot) {
PrintF("\n<--- Last few GCs --->\n%s\n", first_newline);
PrintF("\n<--- JS stacktrace --->\n%s\n", js_stacktrace);
}
- Utils::ApiCheck(false, location, "Allocation failed - process out of memory");
+ if (is_heap_oom) {
+ Utils::ApiCheck(false, location,
Hannes Payer (out of office) 2016/04/07 17:09:24 Please change to: Utils::ApiCheck(false, location,
+ "Allocation failed - JavaScript heap out of memory");
+ } else {
+ Utils::ApiCheck(false, location,
+ "Allocation failed - process out of memory");
+ }
// If the fatal error handler returns, we stop execution.
FATAL("API fatal error handler returned after process out of memory");
}
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698