Commit 77279ad5 authored by Bartek Nowierski's avatar Bartek Nowierski Committed by Commit Bot

Obliterate PartitionAlloc.CommittedSize & BlinkGC.CommittedSize histograms.

They are old and superseded by Memory.Renderer.* & Memory.Experimental.Renderer2.*

Bug: 916761
Change-Id: Ie99a6e37d5f7fe016f71cc713562c468efaf2bde
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1722536Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKeishi Hattori <keishi@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682598}
parent 00e6a265
...@@ -454,12 +454,8 @@ bool Histogram::InspectConstructionArguments(StringPiece name, ...@@ -454,12 +454,8 @@ bool Histogram::InspectConstructionArguments(StringPiece name,
// them here. // them here.
// Blink.UseCounter legitimately has more than 1000 entries in its enum. // Blink.UseCounter legitimately has more than 1000 entries in its enum.
// Arc.OOMKills: https://crbug.com/916757 // Arc.OOMKills: https://crbug.com/916757
// BlinkGC.CommittedSize: https://crbug.com/916761
// PartitionAlloc.CommittedSize: https://crbug.com/916761
if (!name.starts_with("Blink.UseCounter") && if (!name.starts_with("Blink.UseCounter") &&
!name.starts_with("Arc.OOMKills.") && !name.starts_with("Arc.OOMKills.")) {
name != "BlinkGC.CommittedSize" &&
name != "PartitionAlloc.CommittedSize") {
DVLOG(1) << "Histogram: " << name DVLOG(1) << "Histogram: " << name
<< " has bad bucket_count: " << *bucket_count << " (limit " << " has bad bucket_count: " << *bucket_count << " (limit "
<< kBucketCount_MAX << ")"; << kBucketCount_MAX << ")";
......
...@@ -133,7 +133,7 @@ static CSSParserToken Percentage(NumericValueType type, double value) { ...@@ -133,7 +133,7 @@ static CSSParserToken Percentage(NumericValueType type, double value) {
// WTF::Partitions::initialize() multiple times. // WTF::Partitions::initialize() multiple times.
#define DEFINE_TOKEN(name, argument) \ #define DEFINE_TOKEN(name, argument) \
static CSSParserToken& name() { \ static CSSParserToken& name() { \
WTF::Partitions::Initialize(nullptr); \ WTF::Partitions::Initialize(); \
DEFINE_STATIC_LOCAL(CSSParserToken, name, (argument)); \ DEFINE_STATIC_LOCAL(CSSParserToken, name, (argument)); \
return name; \ return name; \
} }
......
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
#include "third_party/blink/renderer/platform/fonts/font_cache_memory_dump_provider.h" #include "third_party/blink/renderer/platform/fonts/font_cache_memory_dump_provider.h"
#include "third_party/blink/renderer/platform/heap/blink_gc_memory_dump_provider.h" #include "third_party/blink/renderer/platform/heap/blink_gc_memory_dump_provider.h"
#include "third_party/blink/renderer/platform/heap/gc_task_runner.h" #include "third_party/blink/renderer/platform/heap/gc_task_runner.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/instrumentation/instance_counters_memory_dump_provider.h" #include "third_party/blink/renderer/platform/instrumentation/instance_counters_memory_dump_provider.h"
#include "third_party/blink/renderer/platform/instrumentation/memory_pressure_listener.h" #include "third_party/blink/renderer/platform/instrumentation/memory_pressure_listener.h"
#include "third_party/blink/renderer/platform/instrumentation/partition_alloc_memory_dump_provider.h" #include "third_party/blink/renderer/platform/instrumentation/partition_alloc_memory_dump_provider.h"
...@@ -130,18 +129,6 @@ static Platform* g_platform = nullptr; ...@@ -130,18 +129,6 @@ static Platform* g_platform = nullptr;
static GCTaskRunner* g_gc_task_runner = nullptr; static GCTaskRunner* g_gc_task_runner = nullptr;
static void MaxObservedSizeFunction(size_t size_in_mb) {
const size_t kSupportedMaxSizeInMB = 4 * 1024;
if (size_in_mb >= kSupportedMaxSizeInMB)
size_in_mb = kSupportedMaxSizeInMB - 1;
// Send a UseCounter only when we see the highest memory usage
// we've ever seen.
DEFINE_STATIC_LOCAL(EnumerationHistogram, committed_size_histogram,
("PartitionAlloc.CommittedSize", kSupportedMaxSizeInMB));
committed_size_histogram.Count(size_in_mb);
}
static void CallOnMainThreadFunction(WTF::MainThreadFunction function, static void CallOnMainThreadFunction(WTF::MainThreadFunction function,
void* context) { void* context) {
PostCrossThreadTask( PostCrossThreadTask(
...@@ -150,7 +137,7 @@ static void CallOnMainThreadFunction(WTF::MainThreadFunction function, ...@@ -150,7 +137,7 @@ static void CallOnMainThreadFunction(WTF::MainThreadFunction function,
} }
Platform::Platform() { Platform::Platform() {
WTF::Partitions::Initialize(MaxObservedSizeFunction); WTF::Partitions::Initialize();
} }
Platform::~Platform() = default; Platform::~Platform() = default;
......
...@@ -1089,23 +1089,6 @@ void UpdateHistograms(const ThreadHeapStatsCollector::Event& event) { ...@@ -1089,23 +1089,6 @@ void UpdateHistograms(const ThreadHeapStatsCollector::Event& event) {
#undef COUNT_BY_GC_REASON #undef COUNT_BY_GC_REASON
} }
static constexpr size_t kSupportedMaxSizeInMB = 4 * 1024;
static size_t max_committed_size_in_mb = 0;
// +1 for rounding up the size to the next MB.
size_t size_in_mb =
event.allocated_space_in_bytes_before_sweeping / 1024 / 1024 + 1;
if (size_in_mb >= kSupportedMaxSizeInMB)
size_in_mb = kSupportedMaxSizeInMB - 1;
if (size_in_mb > max_committed_size_in_mb) {
// Only update the counter for the maximum value.
DEFINE_STATIC_LOCAL(EnumerationHistogram, commited_size_histogram,
("BlinkGC.CommittedSize", kSupportedMaxSizeInMB));
commited_size_histogram.Count(
base::saturated_cast<base::Histogram::Sample>(size_in_mb));
max_committed_size_in_mb = size_in_mb;
}
} }
} // namespace } // namespace
...@@ -1720,8 +1703,6 @@ void ThreadState::MarkPhaseEpilogue(BlinkGC::MarkingType marking_type) { ...@@ -1720,8 +1703,6 @@ void ThreadState::MarkPhaseEpilogue(BlinkGC::MarkingType marking_type) {
Heap().stats_collector()->NotifyMarkingCompleted(marked_bytes); Heap().stats_collector()->NotifyMarkingCompleted(marked_bytes);
WTF::Partitions::ReportMemoryUsageHistogram();
DEFINE_THREAD_SAFE_STATIC_LOCAL( DEFINE_THREAD_SAFE_STATIC_LOCAL(
CustomCountHistogram, total_object_space_histogram, CustomCountHistogram, total_object_space_histogram,
("BlinkGC.TotalObjectSpace", 0, 4 * 1024 * 1024, 50)); ("BlinkGC.TotalObjectSpace", 0, 4 * 1024 * 1024, 50));
......
...@@ -17,7 +17,7 @@ DEFINE_BINARY_PROTO_FUZZER( ...@@ -17,7 +17,7 @@ DEFINE_BINARY_PROTO_FUZZER(
std::cout << fuzzer_input.DebugString() << std::endl; std::cout << fuzzer_input.DebugString() << std::endl;
} }
WTF::Partitions::Initialize(nullptr); WTF::Partitions::Initialize();
base::sequence_manager::SequenceManagerFuzzerProcessor::ParseAndRun( base::sequence_manager::SequenceManagerFuzzerProcessor::ParseAndRun(
fuzzer_input); fuzzer_input);
} }
...@@ -163,7 +163,7 @@ ScopedUnittestsEnvironmentSetup::ScopedUnittestsEnvironmentSetup(int argc, ...@@ -163,7 +163,7 @@ ScopedUnittestsEnvironmentSetup::ScopedUnittestsEnvironmentSetup(int argc,
dummy_platform_ = std::make_unique<Platform>(); dummy_platform_ = std::make_unique<Platform>();
Platform::SetCurrentPlatformForTesting(dummy_platform_.get()); Platform::SetCurrentPlatformForTesting(dummy_platform_.get());
WTF::Partitions::Initialize(nullptr); WTF::Partitions::Initialize();
WTF::Initialize(nullptr); WTF::Initialize(nullptr);
// This must be called after WTF::Initialize(), because ThreadSpecific<> // This must be called after WTF::Initialize(), because ThreadSpecific<>
......
...@@ -65,11 +65,7 @@ static base::LazyInstance<base::PartitionAllocatorGeneric>::Leaky lazy_buffer = ...@@ -65,11 +65,7 @@ static base::LazyInstance<base::PartitionAllocatorGeneric>::Leaky lazy_buffer =
static base::LazyInstance<base::SizeSpecificPartitionAllocator<1024>>::Leaky static base::LazyInstance<base::SizeSpecificPartitionAllocator<1024>>::Leaky
lazy_layout = LAZY_INSTANCE_INITIALIZER; lazy_layout = LAZY_INSTANCE_INITIALIZER;
Partitions::ReportPartitionAllocSizeFunction Partitions::report_size_function_ = void Partitions::Initialize() {
nullptr;
void Partitions::Initialize(
ReportPartitionAllocSizeFunction report_size_function) {
base::subtle::SpinLock::Guard guard(initialization_lock_.Get()); base::subtle::SpinLock::Guard guard(initialization_lock_.Get());
if (!initialized_) { if (!initialized_) {
...@@ -83,7 +79,6 @@ void Partitions::Initialize( ...@@ -83,7 +79,6 @@ void Partitions::Initialize(
array_buffer_allocator_->init(); array_buffer_allocator_->init();
buffer_allocator_->init(); buffer_allocator_->init();
layout_allocator_->init(); layout_allocator_->init();
report_size_function_ = report_size_function;
initialized_ = true; initialized_ = true;
} }
...@@ -99,22 +94,6 @@ void Partitions::StartPeriodicReclaim( ...@@ -99,22 +94,6 @@ void Partitions::StartPeriodicReclaim(
base::PartitionAllocMemoryReclaimer::Instance()->Start(task_runner); base::PartitionAllocMemoryReclaimer::Instance()->Start(task_runner);
} }
void Partitions::ReportMemoryUsageHistogram() {
static size_t observed_max_size_in_mb = 0;
if (!report_size_function_)
return;
// We only report the memory in the main thread.
if (!IsMainThread())
return;
// +1 is for rounding up the sizeInMB.
size_t size_in_mb = Partitions::TotalSizeOfCommittedPages() / 1024 / 1024 + 1;
if (size_in_mb > observed_max_size_in_mb) {
report_size_function_(size_in_mb);
observed_max_size_in_mb = size_in_mb;
}
}
void Partitions::DumpMemoryStats( void Partitions::DumpMemoryStats(
bool is_light_dump, bool is_light_dump,
base::PartitionStatsDumper* partition_stats_dumper) { base::PartitionStatsDumper* partition_stats_dumper) {
......
...@@ -45,13 +45,11 @@ namespace WTF { ...@@ -45,13 +45,11 @@ namespace WTF {
class WTF_EXPORT Partitions { class WTF_EXPORT Partitions {
public: public:
typedef void (*ReportPartitionAllocSizeFunction)(size_t);
// Name of allocator used by tracing for marking sub-allocations while take // Name of allocator used by tracing for marking sub-allocations while take
// memory snapshots. // memory snapshots.
static const char* const kAllocatedObjectPoolName; static const char* const kAllocatedObjectPoolName;
static void Initialize(ReportPartitionAllocSizeFunction); static void Initialize();
static void StartPeriodicReclaim( static void StartPeriodicReclaim(
scoped_refptr<base::SequencedTaskRunner> task_runner); scoped_refptr<base::SequencedTaskRunner> task_runner);
ALWAYS_INLINE static base::PartitionRootGeneric* ArrayBufferPartition() { ALWAYS_INLINE static base::PartitionRootGeneric* ArrayBufferPartition() {
...@@ -93,8 +91,6 @@ class WTF_EXPORT Partitions { ...@@ -93,8 +91,6 @@ class WTF_EXPORT Partitions {
static size_t TotalActiveBytes(); static size_t TotalActiveBytes();
static void ReportMemoryUsageHistogram();
static void DumpMemoryStats(bool is_light_dump, base::PartitionStatsDumper*); static void DumpMemoryStats(bool is_light_dump, base::PartitionStatsDumper*);
ALWAYS_INLINE static void* BufferMalloc(size_t n, const char* type_name) { ALWAYS_INLINE static void* BufferMalloc(size_t n, const char* type_name) {
...@@ -139,7 +135,6 @@ class WTF_EXPORT Partitions { ...@@ -139,7 +135,6 @@ class WTF_EXPORT Partitions {
static base::PartitionAllocatorGeneric* array_buffer_allocator_; static base::PartitionAllocatorGeneric* array_buffer_allocator_;
static base::PartitionAllocatorGeneric* buffer_allocator_; static base::PartitionAllocatorGeneric* buffer_allocator_;
static base::SizeSpecificPartitionAllocator<1024>* layout_allocator_; static base::SizeSpecificPartitionAllocator<1024>* layout_allocator_;
static ReportPartitionAllocSizeFunction report_size_function_;
}; };
} // namespace WTF } // namespace WTF
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include "third_party/blink/renderer/platform/wtf/wtf.h" #include "third_party/blink/renderer/platform/wtf/wtf.h"
int main(int argc, char** argv) { int main(int argc, char** argv) {
WTF::Partitions::Initialize(nullptr); WTF::Partitions::Initialize();
WTF::Initialize(nullptr); WTF::Initialize(nullptr);
return base::RunUnitTestsUsingBaseTestSuite(argc, argv); return base::RunUnitTestsUsingBaseTestSuite(argc, argv);
} }
...@@ -15176,6 +15176,10 @@ uploading your change for review. ...@@ -15176,6 +15176,10 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="BlinkGC.CommittedSize" units="MB" expires_after="M78"> <histogram name="BlinkGC.CommittedSize" units="MB" expires_after="M78">
<obsolete>
Removed as of 07/2019. Use Memory.Renderer.* and
Memory.Experimental.Renderer2.* instead.
</obsolete>
<owner>haraken@chromium.org</owner> <owner>haraken@chromium.org</owner>
<summary> <summary>
The committed memory size in Blink GC. The value is reported when we see the The committed memory size in Blink GC. The value is reported when we see the
...@@ -95022,6 +95026,10 @@ uploading your change for review. ...@@ -95022,6 +95026,10 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="PartitionAlloc.CommittedSize" units="MB" expires_after="M77"> <histogram name="PartitionAlloc.CommittedSize" units="MB" expires_after="M77">
<obsolete>
Removed as of 07/2019. Use Memory.Renderer.* and
Memory.Experimental.Renderer2.* instead.
</obsolete>
<owner>haraken@chromium.org</owner> <owner>haraken@chromium.org</owner>
<summary> <summary>
The committed memory size in PartitionAlloc. The value is reported when we The committed memory size in PartitionAlloc. The value is reported when we
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment