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

Unified Diff: src/heap/heap.h

Issue 1159513003: Even without --trace-gc dump the last few GC messages on OOM (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « src/heap/gc-tracer.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 742aa4ba89c0c3535e7a3c7d8ab0b473479e2544..ef85e16080795813fb518be10a9fec04445d1a3f 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1146,6 +1146,8 @@ class Heap {
static const int kMaxExecutableSizeHugeMemoryDevice =
256 * kPointerMultiplier;
+ static const int kTraceRingBufferSize = 512;
+
// Calculates the allocation limit based on a given growing factor and a
// given old generation size.
intptr_t CalculateOldGenerationAllocationLimit(double factor,
@@ -2153,6 +2155,9 @@ class Heap {
inline void UpdateAllocationsHash(uint32_t value);
inline void PrintAlloctionsHash();
+ void AddToRingBuffer(const char* string);
+ void GetFromRingBuffer(char* buffer);
+
// Object counts and used memory by InstanceType
size_t object_counts_[OBJECT_STATS_COUNT];
size_t object_counts_last_time_[OBJECT_STATS_COUNT];
@@ -2212,6 +2217,13 @@ class Heap {
static const int kAllocationSiteScratchpadSize = 256;
int allocation_sites_scratchpad_length_;
+ char trace_ring_buffer_[kTraceRingBufferSize];
+ // If it's not full then the data is from 0 to ring_buffer_end_. If it's
+ // full then the data is from ring_buffer_end_ to the end of the buffer and
+ // from 0 to ring_buffer_end_.
+ bool ring_buffer_full_;
+ size_t ring_buffer_end_;
+
static const int kMaxMarkCompactsInIdleRound = 7;
static const int kIdleScavengeThreshold = 5;
@@ -2283,7 +2295,8 @@ class HeapStats {
int* objects_per_type; // 17
int* size_per_type; // 18
int* os_error; // 19
- int* end_marker; // 20
+ char* last_few_messages; // 20
+ int* end_marker; // 21
};
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698