 Chromium Code Reviews
 Chromium Code Reviews Issue 1873443002:
  Improved diagnostic message for JS heap out of memory  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master
    
  
    Issue 1873443002:
  Improved diagnostic message for JS heap out of memory  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master| 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"); | 
| } |