Created
August 28, 2020 22:39
-
-
Save ncalexan/05cf2703b0e91810bd5d4267c6918054 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
let mgr = Cc["@mozilla.org/memory-reporter-manager;1"]. | |
getService(Ci.nsIMemoryReporterManager); | |
let amounts = [ | |
"vsize", | |
// "vsizeMaxContiguous", | |
"resident", | |
// "residentFast", | |
"residentPeak", | |
"residentUnique", | |
"heapAllocated", | |
"heapOverheadFraction", | |
// "JSMainRuntimeGCHeap", | |
// "JSMainRuntimeTemporaryPeak", | |
// "JSMainRuntimeRealmsSystem", | |
// "JSMainRuntimeRealmsUser", | |
// "imagesContentUsedUncompressed", | |
// "storageSQLite", | |
// "lowMemoryEventsVirtual", | |
// "lowMemoryEventsCommitSpace", | |
// "lowMemoryEventsPhysical", | |
// "ghostWindows", | |
// "pageFaultsHard", | |
]; | |
// There's something unsettling about actually wanting the | |
// notorious leftpad dependency. | |
let padding = " "; | |
for (let i = 0; i < amounts.length; i++) { | |
let amount = mgr[amounts[i]]; | |
dump(`amounts: ${amounts[i]}: ${padding.substring(amounts[i].length)} ${amount}\n`); | |
} | |
const { AppConstants } = ChromeUtils.import( | |
"resource://gre/modules/AppConstants.jsm" | |
); | |
// Can't use app info from xpcshell. | |
// let appInfo = Cc["@mozilla.org/xre/app-info;1"] | |
// .getService(Ci.nsIXULAppInfo); | |
dump(`version: ${AppConstants.MOZ_APP_VERSION} (${AppConstants.MOZ_BUILDID})\n`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment