void () { if (!isShowing()) { return; } var rt = Runtime.getRuntime(); var maxMem = rt.maxMemory() >> 20; var allocatedMem = rt.totalMemory() >> 20; var usedMem = allocatedMem - (rt.freeMemory() >> 20); var text = UIBundle.message("memory.usage.panel.message.text", usedMem, maxMem); if (allocatedMem != myLastAllocated || usedMem != myLastUsed || !text.equals(getText())) { myLastAllocated = allocatedMem; myLastUsed = usedMem; setText(text); setToolTipText(UIBundle.message("memory.usage.panel.message.tooltip", maxMem, allocatedMem, usedMem)); } }