From ba8f9232017266d24f170f371d56a5bc8259bf59 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Wed, 7 May 2025 00:00:12 -0400 Subject: Various memory measurement improvements (#36834) The two significant changes here are 1) a commit that frees memory used to perform memory reporting once the reporting is complete, 2) memory reporting for the system font service. There are various other commits that remove `#[ignore_malloc_size_of]` attributes for data that we are now able to measure, but they do not significantly change our measurements when testing servo.org. Testing: Comparing the output of about:memory on servo.org. --------- Signed-off-by: Josh Matthews --- components/script/dom/htmlscriptelement.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'components/script/dom/htmlscriptelement.rs') diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 9d0ca807748..777b30d1e63 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -281,19 +281,18 @@ pub(crate) enum ScriptType { pub(crate) struct CompiledSourceCode { #[ignore_malloc_size_of = "SM handles JS values"] pub(crate) source_code: Stencil, - #[ignore_malloc_size_of = "Rc is hard"] + #[conditional_malloc_size_of = "Rc is hard"] pub(crate) original_text: Rc, } -#[derive(JSTraceable)] +#[derive(JSTraceable, MallocSizeOf)] pub(crate) enum SourceCode { - Text(Rc), + Text(#[conditional_malloc_size_of] Rc), Compiled(CompiledSourceCode), } #[derive(JSTraceable, MallocSizeOf)] pub(crate) struct ScriptOrigin { - #[ignore_malloc_size_of = "Rc is hard"] code: SourceCode, #[no_trace] url: ServoUrl, -- cgit v1.2.3