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

Unified Diff: Source/wtf/PartitionAlloc.cpp

Issue 683043002: PartitionAlloc: Distinguish OOMs where a lot of super pages are not committed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/PartitionAlloc.cpp
diff --git a/Source/wtf/PartitionAlloc.cpp b/Source/wtf/PartitionAlloc.cpp
index ab14a4328f122cd7b2e7b56e31c6fc83aadc98c6..b65bf5b3a7eb0526ab43f6a9d42ca1e79329732c 100644
--- a/Source/wtf/PartitionAlloc.cpp
+++ b/Source/wtf/PartitionAlloc.cpp
@@ -296,8 +296,16 @@ bool partitionAllocGenericShutdown(PartitionRootGeneric* root)
return noLeaks;
}
-static NEVER_INLINE void partitionOutOfMemory()
+static NEVER_INLINE void partitionOutOfMemory(const PartitionRootBase* root)
{
+ if ((uint64_t)root->totalSizeOfCommittedPages + 1000000000 < (uint64_t)root->totalSizeOfSuperPages) {
kouhei (in TOK) 2014/10/29 09:34:32 1000000000 should be named as "static const size_t
hiroshige 2014/11/06 10:59:13 Done.
+ // OOMs where a lot of super pages are allocated but not committed,
+ // probably due to http://crbug.com/421387.
+ // Crash at a special address (0x9b)
+ // to be easily distinguished on crash reports.
+ ((void(*)())0x0000009b)();
+ }
+ // Ordinary OOMs (where super pages are consumed and mostly committed).
IMMEDIATE_CRASH();
}
@@ -701,7 +709,7 @@ void* partitionAllocSlowPath(PartitionRootBase* root, int flags, size_t size, Pa
partitionAllocSlowPathFailed:
if (returnNull)
return nullptr;
- partitionOutOfMemory();
+ partitionOutOfMemory(root);
return nullptr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698