* Monitor used memory in kb.
*/
public static void monitorUsedMemoryInKB() {
final int longQuantityId = Audits.mapAudit("USED_MEMORY_IN_KB");
final LongQuantity longQuantity = Audits.getLongQuantity(longQuantityId);
longQuantity.setProvider(new AuditProvider() {
public void updateAudit() {
long usedMemory = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / KILOBYTE;
longQuantity.set(usedMemory);
}
});