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

Unified Diff: src/profile-generator.cc

Issue 9375047: Heap Snapshot maximum size limit is too low for really big apps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: the limit depends from the platform. Created 8 years, 10 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/profile-generator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index c6e6131a71ea0e343a53dc133f99e21195d9d8e0..2b5580b352abd92477943dc08c096853eaebea7b 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -3411,8 +3411,13 @@ class OutputStreamWriter {
bool aborted_;
};
+#if defined(V8_TARGET_ARCH_X64)
+const int HeapSnapshotJSONSerializer::kMaxSerializableSnapshotRawSize =
+ 768 * MB;
mnaganov (inactive) 2012/02/10 12:33:50 I know a better place for this: SnapshotSizeConsta
+#else
const int HeapSnapshotJSONSerializer::kMaxSerializableSnapshotRawSize =
256 * MB;
+#endif
void HeapSnapshotJSONSerializer::Serialize(v8::OutputStream* stream) {
ASSERT(writer_ == NULL);
@@ -3422,7 +3427,7 @@ void HeapSnapshotJSONSerializer::Serialize(v8::OutputStream* stream) {
if (snapshot_->raw_entries_size() >= kMaxSerializableSnapshotRawSize) {
// The snapshot is too big. Serialize a fake snapshot.
original_snapshot = snapshot_;
- snapshot_ = CreateFakeSnapshot();
+ snapshot_ = CreateFakeSnapshot(snapshot_->raw_entries_size());
mnaganov (inactive) 2012/02/10 12:33:50 Why can't CreateFakeSnapshot extract this value it
}
// Since nodes graph is cyclic, we need the first pass to enumerate
// them. Strings can be serialized in one pass.
@@ -3439,15 +3444,22 @@ void HeapSnapshotJSONSerializer::Serialize(v8::OutputStream* stream) {
}
-HeapSnapshot* HeapSnapshotJSONSerializer::CreateFakeSnapshot() {
+HeapSnapshot* HeapSnapshotJSONSerializer::CreateFakeSnapshot(
+ int raw_snapshot_size) {
HeapSnapshot* result = new HeapSnapshot(snapshot_->collection(),
HeapSnapshot::kFull,
snapshot_->title(),
snapshot_->uid());
result->AllocateEntries(2, 1, 0);
HeapEntry* root = result->AddRootEntry(1);
+ const char* text = snapshot_->collection()->names()->GetFormatted(
+ "The snapshot is too big. "
+ "Maximum snapshot size is %d MB. "
+ "Actual snapshot size is %d MB.",
+ kMaxSerializableSnapshotRawSize / MB,
+ (raw_snapshot_size + MB - 1) / MB);
HeapEntry* message = result->AddEntry(
- HeapEntry::kString, "The snapshot is too big", 0, 4, 0, 0);
+ HeapEntry::kString, text, 0, 4, 0, 0);
root->SetUnidirElementReference(0, 1, message);
result->SetDominatorsToSelf();
return result;
« no previous file with comments | « src/profile-generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698