public void updateMemory() {
		DecimalFormat format = new DecimalFormat("0.0");

		Runtime rt = java.lang.Runtime.getRuntime();
		float maxMemory = rt.maxMemory() / (1024f * 1024f);
		float totalUsed = (rt.totalMemory() - rt.freeMemory()) / (1024f * 1024f);
		float docMem = 0;
		float undoMem = 0;

		CPArtwork artwork = controller.getArtwork();
		if (artwork != null) {
			docMem = artwork.getDocMemoryUsed() / (1024f * 1024f);
			undoMem = artwork.getUndoMemoryUsed() / (1024f * 1024f);
		}

		if ((docMem + undoMem) / maxMemory > .5) {
			memory.setForeground(Color.RED);
		} else {
			memory.setForeground(Color.BLACK);
		}
                String zerofiller = "";
                if (totalUsed < 10) zerofiller = "0";

		memory.setText(CPMainGUI.language.getString("status_edit_mem") +
                        ": " + zerofiller + format.format(totalUsed) + "/" + format.format(maxMemory) + ",D"
				+ format.format(docMem) + " U" + format.format(undoMem));
	}