!7 compact module MemoryTrayIcon > DynPrintLog { transient S value; // OS size in MB + free memory transient JLabel lbl; transient bool _startMinimized = true; start { dm_addTrayIcon(onLeftClick(rThread { print("GC!"); timedGCPlusDeadlockSolving_printAlways(); }, lbl = dm_fieldLabel_noAutoToolTip('value))); componentPopupMenuItems(lbl, "Garbage Collect", rThread { dm_gc(); actualUpdate(); }, "Show Module", rThread dm_showModule); doEveryAndNow(10.0, r actualUpdate); } void actualUpdate { long mb = toM(oshi_currentProcessResidentSize()); long mb2 = toM(freeSystemMemory()); setField(value := mb + " / " + mb2); toolTip(lbl, "OS size in memory: " + mb + " MB, free system memory: " + mb2 + " MB"); } }