OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 decommitFreeableMemory(); | 110 decommitFreeableMemory(); |
111 partitionDumpStatsGeneric(fastMallocPartition(), "fast_malloc", isLightDump,
partitionStatsDumper); | 111 partitionDumpStatsGeneric(fastMallocPartition(), "fast_malloc", isLightDump,
partitionStatsDumper); |
112 partitionDumpStatsGeneric(bufferPartition(), "buffer", isLightDump, partitio
nStatsDumper); | 112 partitionDumpStatsGeneric(bufferPartition(), "buffer", isLightDump, partitio
nStatsDumper); |
113 partitionDumpStats(layoutPartition(), "layout", isLightDump, partitionStatsD
umper); | 113 partitionDumpStats(layoutPartition(), "layout", isLightDump, partitionStatsD
umper); |
114 } | 114 } |
115 | 115 |
116 static NEVER_INLINE void partitionsOutOfMemoryUsing2G() | 116 static NEVER_INLINE void partitionsOutOfMemoryUsing2G() |
117 { | 117 { |
118 size_t signature = 2UL * 1024 * 1024 * 1024; | 118 size_t signature = 2UL * 1024 * 1024 * 1024; |
119 base::debug::Alias(&signature); | 119 base::debug::Alias(&signature); |
120 IMMEDIATE_CRASH(); | 120 OOM_CRASH(); |
121 } | 121 } |
122 | 122 |
123 static NEVER_INLINE void partitionsOutOfMemoryUsing1G() | 123 static NEVER_INLINE void partitionsOutOfMemoryUsing1G() |
124 { | 124 { |
125 size_t signature = 1UL * 1024 * 1024 * 1024; | 125 size_t signature = 1UL * 1024 * 1024 * 1024; |
126 base::debug::Alias(&signature); | 126 base::debug::Alias(&signature); |
127 IMMEDIATE_CRASH(); | 127 OOM_CRASH(); |
128 } | 128 } |
129 | 129 |
130 static NEVER_INLINE void partitionsOutOfMemoryUsing512M() | 130 static NEVER_INLINE void partitionsOutOfMemoryUsing512M() |
131 { | 131 { |
132 size_t signature = 512 * 1024 * 1024; | 132 size_t signature = 512 * 1024 * 1024; |
133 base::debug::Alias(&signature); | 133 base::debug::Alias(&signature); |
134 IMMEDIATE_CRASH(); | 134 OOM_CRASH(); |
135 } | 135 } |
136 | 136 |
137 static NEVER_INLINE void partitionsOutOfMemoryUsing256M() | 137 static NEVER_INLINE void partitionsOutOfMemoryUsing256M() |
138 { | 138 { |
139 size_t signature = 256 * 1024 * 1024; | 139 size_t signature = 256 * 1024 * 1024; |
140 base::debug::Alias(&signature); | 140 base::debug::Alias(&signature); |
141 IMMEDIATE_CRASH(); | 141 OOM_CRASH(); |
142 } | 142 } |
143 | 143 |
144 static NEVER_INLINE void partitionsOutOfMemoryUsing128M() | 144 static NEVER_INLINE void partitionsOutOfMemoryUsing128M() |
145 { | 145 { |
146 size_t signature = 128 * 1024 * 1024; | 146 size_t signature = 128 * 1024 * 1024; |
147 base::debug::Alias(&signature); | 147 base::debug::Alias(&signature); |
148 IMMEDIATE_CRASH(); | 148 OOM_CRASH(); |
149 } | 149 } |
150 | 150 |
151 static NEVER_INLINE void partitionsOutOfMemoryUsing64M() | 151 static NEVER_INLINE void partitionsOutOfMemoryUsing64M() |
152 { | 152 { |
153 size_t signature = 64 * 1024 * 1024; | 153 size_t signature = 64 * 1024 * 1024; |
154 base::debug::Alias(&signature); | 154 base::debug::Alias(&signature); |
155 IMMEDIATE_CRASH(); | 155 OOM_CRASH(); |
156 } | 156 } |
157 | 157 |
158 static NEVER_INLINE void partitionsOutOfMemoryUsing32M() | 158 static NEVER_INLINE void partitionsOutOfMemoryUsing32M() |
159 { | 159 { |
160 size_t signature = 32 * 1024 * 1024; | 160 size_t signature = 32 * 1024 * 1024; |
161 base::debug::Alias(&signature); | 161 base::debug::Alias(&signature); |
162 IMMEDIATE_CRASH(); | 162 OOM_CRASH(); |
163 } | 163 } |
164 | 164 |
165 static NEVER_INLINE void partitionsOutOfMemoryUsing16M() | 165 static NEVER_INLINE void partitionsOutOfMemoryUsing16M() |
166 { | 166 { |
167 size_t signature = 16 * 1024 * 1024; | 167 size_t signature = 16 * 1024 * 1024; |
168 base::debug::Alias(&signature); | 168 base::debug::Alias(&signature); |
169 IMMEDIATE_CRASH(); | 169 OOM_CRASH(); |
170 } | 170 } |
171 | 171 |
172 static NEVER_INLINE void partitionsOutOfMemoryUsingLessThan16M() | 172 static NEVER_INLINE void partitionsOutOfMemoryUsingLessThan16M() |
173 { | 173 { |
174 size_t signature = 16 * 1024 * 1024 - 1; | 174 size_t signature = 16 * 1024 * 1024 - 1; |
175 base::debug::Alias(&signature); | 175 base::debug::Alias(&signature); |
176 DLOG(FATAL) << "ParitionAlloc: out of memory with < 16M usage (error:" << ge
tAllocPageErrorCode() << ")"; | 176 DLOG(FATAL) << "ParitionAlloc: out of memory with < 16M usage (error:" << ge
tAllocPageErrorCode() << ")"; |
177 } | 177 } |
178 | 178 |
179 void Partitions::handleOutOfMemory() | 179 void Partitions::handleOutOfMemory() |
(...skipping 15 matching lines...) Expand all Loading... |
195 if (totalUsage >= 64 * 1024 * 1024) | 195 if (totalUsage >= 64 * 1024 * 1024) |
196 partitionsOutOfMemoryUsing64M(); | 196 partitionsOutOfMemoryUsing64M(); |
197 if (totalUsage >= 32 * 1024 * 1024) | 197 if (totalUsage >= 32 * 1024 * 1024) |
198 partitionsOutOfMemoryUsing32M(); | 198 partitionsOutOfMemoryUsing32M(); |
199 if (totalUsage >= 16 * 1024 * 1024) | 199 if (totalUsage >= 16 * 1024 * 1024) |
200 partitionsOutOfMemoryUsing16M(); | 200 partitionsOutOfMemoryUsing16M(); |
201 partitionsOutOfMemoryUsingLessThan16M(); | 201 partitionsOutOfMemoryUsingLessThan16M(); |
202 } | 202 } |
203 | 203 |
204 } // namespace WTF | 204 } // namespace WTF |
OLD | NEW |