!7 cmodule OSSizeTrayIcon > DynPrintLog { transient S value; // size in MB 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, "Remove", rThread dm_deleteModule); doEveryAndNow(10.0, r actualUpdate); } void actualUpdate { long mb = toM(oshi_currentProcessResidentSize()); setField(value := str(mb)); toolTip(lbl, "OS size in memory: " + mb + " MB"); } }