/**
* Obtains the string that represents the architecture.
*/
private static class MonitorTask implements Callable<MemoryUsage,IOException> {
public MemoryUsage call() throws IOException {
MemoryMonitor mm;
try {
mm = MemoryMonitor.get();
} catch (IOException e) {
if(!warned) {
// report the problem just once, and avoid filling up the log with the same error. see HUDSON-2194.
warned = true;
throw e;
} else {
return null;
}
}
return new MemoryUsage2(mm.monitor());
}