diff --git a/extensions/DevidBittFive/ramusage.js b/extensions/DevidBittFive/ramusage.js
new file mode 100644
index 0000000000..50a4cea588
--- /dev/null
+++ b/extensions/DevidBittFive/ramusage.js
@@ -0,0 +1,72 @@
+// Name: RAM Monitor
+// ID: bitterRamUsage
+// Description: Monitors current RAM usage and percentage.
+// By: DevidBittFive
+// License: EPL-2.0 OR GPL-2.0-or-later
+
+/**!
+ * @license EPL-2.0 OR GPL-2.0-or-later
+ * All code contained in this extension is licensed under the Eclipse Public License v2.0.
+ *
+ * If you have not received a copy of this license, you may access it
+ * at the following link: https://www.eclipse.org/legal/epl-2.0/
+ */
+
+(function (Scratch) {
+ "use strict";
+
+ // Cache once outside the class
+ const mem =
+ globalThis.performance && globalThis.performance.memory
+ ? globalThis.performance.memory
+ : null;
+
+ class RamUsageExtension {
+ getInfo() {
+ return {
+ id: "bitterRamUsage",
+ name: Scratch.translate("RAM Monitor"),
+ blocks: [
+ {
+ blockType: Scratch.BlockType.XML,
+ xml: mem
+ ? ""
+ : `
+
+
+
+
+ `,
+ },
+ {
+ opcode: "getRamUsageMB",
+ blockType: Scratch.BlockType.REPORTER,
+ text: Scratch.translate("get RAM usage in MB"),
+ },
+ {
+ opcode: "getRamUsagePercent",
+ blockType: Scratch.BlockType.REPORTER,
+ text: Scratch.translate("get RAM usage percent"),
+ },
+ ],
+ };
+ }
+
+ getRamUsageMB() {
+ // Check the cached mem variable directly
+ if (!mem) return NaN;
+
+ return mem.usedJSHeapSize / 1024 / 1024;
+ }
+
+ getRamUsagePercent() {
+ // Simplified check
+ if (!mem) return NaN;
+
+ // Calculate percentage as a raw number
+ return (mem.usedJSHeapSize / mem.jsHeapSizeLimit) * 100;
+ }
+ }
+
+ Scratch.extensions.register(new RamUsageExtension());
+})(Scratch);
diff --git a/extensions/extensions.json b/extensions/extensions.json
index 442f300d59..f6ca7836ca 100644
--- a/extensions/extensions.json
+++ b/extensions/extensions.json
@@ -39,6 +39,7 @@
"shreder95ua/resolution",
"XmerOriginals/closecontrol",
"navigator",
+ "DevidBittFive/ramusage",
"battery",
"PwLDev/vibration",
"TheShovel/CustomStyles",