From 814a76954107bd7cc6f7215b35a452216d8e81bc Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Mon, 12 Feb 2024 17:12:48 +0800 Subject: [PATCH] Issue #2251 - Expose unlink ghost windows to about:memory --- toolkit/components/aboutmemory/content/aboutMemory.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/toolkit/components/aboutmemory/content/aboutMemory.js b/toolkit/components/aboutmemory/content/aboutMemory.js index 100228c4bb..243ffbd840 100644 --- a/toolkit/components/aboutmemory/content/aboutMemory.js +++ b/toolkit/components/aboutmemory/content/aboutMemory.js @@ -304,6 +304,9 @@ function onLoad() "collection followed by a cycle collection, and causes the " + "process to reduce memory usage in other ways, e.g. by " + "flushing various caches."; + const UGDesc = "Unlink any known ghost windows, to enable investigating " + + "what caused them. This is only for debugging leaks, and " + + "can cause bad things to happen if called."; const GCAndCCLogDesc = "Save garbage collection log and concise cycle " + "collection log.\n" + @@ -357,6 +360,7 @@ function onLoad() appendButton(row3, GCDesc, doGC, "GC"); appendButton(row3, CCDesc, doCC, "CC"); appendButton(row3, MMDesc, doMMU, "Minimize memory usage"); + appendButton(row3, UGDesc, doUGW, "Unlink ghost windows"); let row4 = appendElement(ops, "div", "opsRow"); @@ -429,6 +433,12 @@ function doMMU() () => updateMainAndFooter("Memory minimization completed", HIDE_FOOTER)); } +function doUGW() +{ + Cu.unlinkGhostWindows(); + updateMainAndFooter("Unlink ghost windows completed", HIDE_FOOTER); +} + function doMeasure() { updateAboutMemoryFromReporters();