| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 { | 65 { |
| 66 // We could ASSERT here for a memory leak within the partition, but it leads | 66 // We could ASSERT here for a memory leak within the partition, but it leads |
| 67 // to very hard to diagnose ASSERTs, so it's best to leave leak checking for | 67 // to very hard to diagnose ASSERTs, so it's best to leave leak checking for |
| 68 // the valgrind and heapcheck bots, which run without partitions. | 68 // the valgrind and heapcheck bots, which run without partitions. |
| 69 (void) m_renderingAllocator.shutdown(); | 69 (void) m_renderingAllocator.shutdown(); |
| 70 (void) m_objectModelAllocator.shutdown(); | 70 (void) m_objectModelAllocator.shutdown(); |
| 71 (void) m_bufferAllocator.shutdown(); | 71 (void) m_bufferAllocator.shutdown(); |
| 72 (void) m_fastMallocAllocator.shutdown(); | 72 (void) m_fastMallocAllocator.shutdown(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void Partitions::decommitFreeableMemory() |
| 76 { |
| 77 ASSERT(isMainThread()); |
| 78 |
| 79 partitionPurgeMemoryGeneric(getBufferPartition()); |
| 80 partitionPurgeMemoryGeneric(getFastMallocPartition()); |
| 81 partitionPurgeMemory(getObjectModelPartition()); |
| 82 partitionPurgeMemory(getRenderingPartition()); |
| 83 } |
| 84 |
| 75 void Partitions::reportMemoryUsageHistogram() | 85 void Partitions::reportMemoryUsageHistogram() |
| 76 { | 86 { |
| 77 static size_t supportedMaxSizeInMB = 4 * 1024; | 87 static size_t supportedMaxSizeInMB = 4 * 1024; |
| 78 static size_t observedMaxSizeInMB = 0; | 88 static size_t observedMaxSizeInMB = 0; |
| 79 | 89 |
| 80 if (!m_histogramEnumeration) | 90 if (!m_histogramEnumeration) |
| 81 return; | 91 return; |
| 82 // We only report the memory in the main thread. | 92 // We only report the memory in the main thread. |
| 83 if (!isMainThread()) | 93 if (!isMainThread()) |
| 84 return; | 94 return; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 100 // accessed only on the main thread. | 110 // accessed only on the main thread. |
| 101 ASSERT(isMainThread()); | 111 ASSERT(isMainThread()); |
| 102 | 112 |
| 103 partitionDumpStatsGeneric(getFastMallocPartition(), "fast_malloc_partition",
partitionStatsDumper); | 113 partitionDumpStatsGeneric(getFastMallocPartition(), "fast_malloc_partition",
partitionStatsDumper); |
| 104 partitionDumpStatsGeneric(getBufferPartition(), "buffer_partition", partitio
nStatsDumper); | 114 partitionDumpStatsGeneric(getBufferPartition(), "buffer_partition", partitio
nStatsDumper); |
| 105 partitionDumpStats(getObjectModelPartition(), "object_model_partition", part
itionStatsDumper); | 115 partitionDumpStats(getObjectModelPartition(), "object_model_partition", part
itionStatsDumper); |
| 106 partitionDumpStats(getRenderingPartition(), "rendering_partition", partition
StatsDumper); | 116 partitionDumpStats(getRenderingPartition(), "rendering_partition", partition
StatsDumper); |
| 107 } | 117 } |
| 108 | 118 |
| 109 } // namespace WTF | 119 } // namespace WTF |
| OLD | NEW |