Chromium Code Reviews| 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; |
| } |