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); l.setForeground(blendColors(Color.black, Color.green, ratio)); l.setToolTipText(toolTip); } }); onClick(l, r { fullGCInBackground() }); ret l; }