sbool jMemoryView_debug; static JLabel jMemoryView() { final JLabel l = jlabel(); installTimer(l, 500, new Runnable { long compilationTime; public void run { //l.setText("T: " + toM(totalMemory()) + "M"); //l.setToolTipText("T = Total Java heap. Process ID: " + getPID()); l.setText(toM(usedMemory()) + "/" + toM(totalMemory()) + "M"); S toolTip = "RAM used/total. Process ID: " + getPID(); long t = hotSpotCompilationTime(); bool compiling = t >= compilationTime + 500/10; float ratio = (t-compilationTime)/500f; compilationTime = t; if (compiling) toolTip += ". OPTIMIZING"; //l.setForeground(compiling ? Color.green : Color.black); Color color = blendColors(Color.black, Color.green, ratio); l.setForeground(color); if (jMemoryView_debug) print("jMemoryView ratio: " + ratio + ", color: " + color); l.setToolTipText(toolTip); } }); onLeftClick(l, r { fullGCInBackground() }); ret l; }