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

Unified Diff: src/api.cc

Issue 3046049: Add information about memory allocator's size and capacity and heap snapshot into heap stats. (Closed)
Patch Set: Slava's variant of wording Created 10 years, 4 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.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 48c64b314088fc40e8f048c78c1e0b9a77e649a8..4fdc95f5ee8a7b27bf01da11f72a6e3a1cd23136 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -126,7 +126,7 @@ static FatalErrorCallback& GetFatalErrorHandler() {
// 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) {
+void i::V8::FatalProcessOutOfMemory(const char* location, bool take_snapshot) {
i::HeapStats heap_stats;
int start_marker;
heap_stats.start_marker = &start_marker;
@@ -166,9 +166,17 @@ void i::V8::FatalProcessOutOfMemory(const char* location) {
heap_stats.near_death_global_handle_count = &near_death_global_handle_count;
int destroyed_global_handle_count;
heap_stats.destroyed_global_handle_count = &destroyed_global_handle_count;
+ int memory_allocator_size;
+ heap_stats.memory_allocator_size = &memory_allocator_size;
+ int memory_allocator_capacity;
+ heap_stats.memory_allocator_capacity = &memory_allocator_capacity;
+ int objects_per_type[LAST_TYPE + 1] = {0};
+ heap_stats.objects_per_type = objects_per_type;
+ int size_per_type[LAST_TYPE + 1] = {0};
+ heap_stats.size_per_type = size_per_type;
int end_marker;
heap_stats.end_marker = &end_marker;
- i::Heap::RecordStats(&heap_stats);
+ i::Heap::RecordStats(&heap_stats, take_snapshot);
i::V8::SetFatalError();
FatalErrorCallback callback = GetFatalErrorHandler();
{
« no previous file with comments | « no previous file | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698