Revert "Bug 1964451 - Add use counters for OOM handling r=sfink,mccr8" on request

This reverts commit 7ae56a0292.
This commit is contained in:
Cristina Horotan
2025-05-21 22:38:12 +03:00
committed by chorotan@mozilla.com
parent 42fb8b29f4
commit 1f1ce5eb80
3 changed files with 3 additions and 173 deletions

View File

@@ -85,10 +85,6 @@ custom JS_errorstack_setter_no_errordata called error.stack setter on object wit
custom JS_dateparse called Date.parse custom JS_dateparse called Date.parse
custom JS_dateparse_impl_def call to Date.parse used implementation defined behaviour custom JS_dateparse_impl_def call to Date.parse used implementation defined behaviour
custom JS_regexp_symbol_protocol_on_primitive passed a primitive with a custom implementation of the regexp protocol symbols to one of the String methods that accept a regexp custom JS_regexp_symbol_protocol_on_primitive passed a primitive with a custom implementation of the regexp protocol symbols to one of the String methods that accept a regexp
custom JS_large_oom_reported reported a large oom
custom JS_small_oom_reported reported a small oom
custom JS_large_oom_recovered recovered a large oom
custom JS_small_oom_recovered recovered a small oom
// Console API // Console API
method console.assert method console.assert

View File

@@ -107,8 +107,8 @@ use.counter:
send_in_pings: send_in_pings:
- use-counters - use-counters
# Total of 2405 use counter metrics (excludes denominators). # Total of 2397 use counter metrics (excludes denominators).
# Total of 362 'page' use counters. # Total of 358 'page' use counters.
use.counter.page: use.counter.page:
svgsvgelement_getelementbyid: svgsvgelement_getelementbyid:
type: counter type: counter
@@ -824,74 +824,6 @@ use.counter.page:
send_in_pings: send_in_pings:
- use-counters - use-counters
js_large_oom_reported:
type: counter
description: >
Whether a page reported a large oom.
Compare against `use.counter.top_level_content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
js_small_oom_reported:
type: counter
description: >
Whether a page reported a small oom.
Compare against `use.counter.top_level_content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
js_large_oom_recovered:
type: counter
description: >
Whether a page recovered a large oom.
Compare against `use.counter.top_level_content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
js_small_oom_recovered:
type: counter
description: >
Whether a page recovered a small oom.
Compare against `use.counter.top_level_content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
console_assert: console_assert:
type: counter type: counter
description: > description: >
@@ -6264,7 +6196,7 @@ use.counter.page:
send_in_pings: send_in_pings:
- use-counters - use-counters
# Total of 362 'document' use counters. # Total of 358 'document' use counters.
use.counter.doc: use.counter.doc:
svgsvgelement_getelementbyid: svgsvgelement_getelementbyid:
type: counter type: counter
@@ -6980,74 +6912,6 @@ use.counter.doc:
send_in_pings: send_in_pings:
- use-counters - use-counters
js_large_oom_reported:
type: counter
description: >
Whether a document reported a large oom.
Compare against `use.counter.content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
js_small_oom_reported:
type: counter
description: >
Whether a document reported a small oom.
Compare against `use.counter.content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
js_large_oom_recovered:
type: counter
description: >
Whether a document recovered a large oom.
Compare against `use.counter.content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
js_small_oom_recovered:
type: counter
description: >
Whether a document recovered a small oom.
Compare against `use.counter.content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
console_assert: console_assert:
type: counter type: counter
description: > description: >

View File

@@ -1992,14 +1992,7 @@ bool CycleCollectedJSRuntime::OOMReported() {
void CycleCollectedJSRuntime::AnnotateAndSetOutOfMemory(OOMState* aStatePtr, void CycleCollectedJSRuntime::AnnotateAndSetOutOfMemory(OOMState* aStatePtr,
OOMState aNewState) { OOMState aNewState) {
enum class Size { Large, Small };
Size size = aStatePtr == &mOutOfMemoryState ? Size::Small : Size::Large;
MOZ_ASSERT_IF(size == Size::Large,
aStatePtr == &mLargeAllocationFailureState);
*aStatePtr = aNewState; *aStatePtr = aNewState;
CrashReporter::Annotation annotation = CrashReporter::Annotation annotation =
(aStatePtr == &mOutOfMemoryState) (aStatePtr == &mOutOfMemoryState)
? CrashReporter::Annotation::JSOutOfMemory ? CrashReporter::Annotation::JSOutOfMemory
@@ -2007,29 +2000,6 @@ void CycleCollectedJSRuntime::AnnotateAndSetOutOfMemory(OOMState* aStatePtr,
CrashReporter::RecordAnnotationCString(annotation, CrashReporter::RecordAnnotationCString(annotation,
OOMStateToString(aNewState)); OOMStateToString(aNewState));
// Attempt to report telemetry.
if (JSObject* global = JS::CurrentGlobalOrNull(GetContext()->Context())) {
if (aNewState == OOMState::Recovered) {
switch (size) {
case Size::Large:
SetUseCounter(global, eUseCounter_custom_JS_large_oom_recovered);
break;
case Size::Small:
SetUseCounter(global, eUseCounter_custom_JS_small_oom_recovered);
break;
}
} else {
switch (size) {
case Size::Large:
SetUseCounter(global, eUseCounter_custom_JS_large_oom_reported);
break;
case Size::Small:
SetUseCounter(global, eUseCounter_custom_JS_small_oom_reported);
break;
}
}
}
} }
void CycleCollectedJSRuntime::OnGC(JSContext* aContext, JSGCStatus aStatus, void CycleCollectedJSRuntime::OnGC(JSContext* aContext, JSGCStatus aStatus,