Sun . Java . Code Library . u*

updateStatus () { // REMARK all components can be updated ...
Runtime rTime = Runtime.getRuntime ();
long free = rTime.freeMemory ();
long total = rTime.totalMemory ();
while (total > Integer.MAX_VALUE) { // REMARK avoiding overflow
total = total >> 1;
free = free >> 1;
}
int taken = (int) (total - free);
status.setMaximum ((int)total);
status.setValue (taken);
text.setText (msgMemory.format (new   Object[] {new Long (total),new Long (free),new Integer (taken)}));
text.invalidate ();
validate ();
}