From 9f9e7e391945335a68f1192e0978d3b0979637b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Thu, 17 Nov 2022 07:59:41 +0100 Subject: [PATCH] FFDec Debug menu - show really used memory, clear all caches option --- src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index 396f9780c..9749f3361 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.tags.ABCContainerTag; import com.jpexs.decompiler.flash.treeitems.SWFList; import com.jpexs.decompiler.flash.treeitems.TreeItem; import com.jpexs.helpers.ByteArrayRange; +import com.jpexs.helpers.Cache; import com.jpexs.helpers.Helper; import com.jpexs.helpers.utf8.Utf8Helper; import com.sun.jna.Platform; @@ -1128,6 +1129,9 @@ public abstract class MainFrameMenu implements MenuBuilder { nswf.clearAllCache(); } }, PRIORITY_MEDIUM, null, true, null, false); + addMenuItem("/debug/emptyAllCache", "Empty all caches", "continue16", e -> { + Cache.clearAll(); + }, PRIORITY_MEDIUM, null, true, null, false); addMenuItem("/debug/memoryInformation", "Memory information", "continue16", e -> { String architecture = System.getProperty("sun.arch.data.model"); Runtime runtime = Runtime.getRuntime(); @@ -1135,7 +1139,8 @@ public abstract class MainFrameMenu implements MenuBuilder { + "Jre 64bit: " + Helper.is64BitJre() + Helper.newLine + "Os 64bit: " + Helper.is64BitOs() + Helper.newLine + "Max: " + (runtime.maxMemory() / 1024 / 1024) + "MB" + Helper.newLine - + "Used: " + (runtime.totalMemory() / 1024 / 1024) + "MB" + Helper.newLine + + "Total: " + (runtime.totalMemory()/ 1024 / 1024) + "MB" + Helper.newLine + + "Used: " + ((runtime.totalMemory() - runtime.freeMemory()) / 1024 / 1024) + "MB" + Helper.newLine + "Free: " + (runtime.freeMemory() / 1024 / 1024) + "MB"; ViewMessages.showMessageDialog(Main.getDefaultMessagesComponent(), info); SWF nswf = mainFrame.getPanel().getCurrentSwf();