| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 initialized_ = true; | 63 initialized_ = true; |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 void Partitions::DecommitFreeableMemory() { | 67 void Partitions::DecommitFreeableMemory() { |
| 68 CHECK(IsMainThread()); | 68 CHECK(IsMainThread()); |
| 69 if (!initialized_) | 69 if (!initialized_) |
| 70 return; | 70 return; |
| 71 | 71 |
| 72 PartitionPurgeMemoryGeneric(ArrayBufferPartition(), | 72 PartitionPurgeMemoryGeneric(ArrayBufferPartition(), |
| 73 base::PartitionPurgeDecommitEmptyPages); | 73 base::PartitionPurgeDecommitEmptyPages | |
| 74 base::PartitionPurgeDiscardUnusedSystemPages); |
| 74 PartitionPurgeMemoryGeneric(BufferPartition(), | 75 PartitionPurgeMemoryGeneric(BufferPartition(), |
| 75 base::PartitionPurgeDecommitEmptyPages); | 76 base::PartitionPurgeDecommitEmptyPages | |
| 77 base::PartitionPurgeDiscardUnusedSystemPages); |
| 76 PartitionPurgeMemoryGeneric(FastMallocPartition(), | 78 PartitionPurgeMemoryGeneric(FastMallocPartition(), |
| 77 base::PartitionPurgeDecommitEmptyPages); | 79 base::PartitionPurgeDecommitEmptyPages | |
| 80 base::PartitionPurgeDiscardUnusedSystemPages); |
| 78 PartitionPurgeMemory(LayoutPartition(), | 81 PartitionPurgeMemory(LayoutPartition(), |
| 79 base::PartitionPurgeDecommitEmptyPages); | 82 base::PartitionPurgeDecommitEmptyPages | |
| 83 base::PartitionPurgeDiscardUnusedSystemPages); |
| 80 } | 84 } |
| 81 | 85 |
| 82 void Partitions::ReportMemoryUsageHistogram() { | 86 void Partitions::ReportMemoryUsageHistogram() { |
| 83 static size_t observed_max_size_in_mb = 0; | 87 static size_t observed_max_size_in_mb = 0; |
| 84 | 88 |
| 85 if (!report_size_function_) | 89 if (!report_size_function_) |
| 86 return; | 90 return; |
| 87 // We only report the memory in the main thread. | 91 // We only report the memory in the main thread. |
| 88 if (!IsMainThread()) | 92 if (!IsMainThread()) |
| 89 return; | 93 return; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 if (total_usage >= 64 * 1024 * 1024) | 190 if (total_usage >= 64 * 1024 * 1024) |
| 187 PartitionsOutOfMemoryUsing64M(); | 191 PartitionsOutOfMemoryUsing64M(); |
| 188 if (total_usage >= 32 * 1024 * 1024) | 192 if (total_usage >= 32 * 1024 * 1024) |
| 189 PartitionsOutOfMemoryUsing32M(); | 193 PartitionsOutOfMemoryUsing32M(); |
| 190 if (total_usage >= 16 * 1024 * 1024) | 194 if (total_usage >= 16 * 1024 * 1024) |
| 191 PartitionsOutOfMemoryUsing16M(); | 195 PartitionsOutOfMemoryUsing16M(); |
| 192 PartitionsOutOfMemoryUsingLessThan16M(); | 196 PartitionsOutOfMemoryUsingLessThan16M(); |
| 193 } | 197 } |
| 194 | 198 |
| 195 } // namespace WTF | 199 } // namespace WTF |
| OLD | NEW |