log.warn("Memory is running low ...");
freeSomeMemory(freeMemory, totalMemory);
freeMemory = Runtime.getRuntime().freeMemory();
totalMemory = Runtime.getRuntime().totalMemory();
if (isLowMemory(freeMemory, totalMemory)) {
getControllerStatus().setResponse(new SendErrorResponse(503));
getControllerStatus().consumeURIPart(getControllerStatus().getURIToBeConsumed());
log.error("Memory is so low that a user request had to be canceled - 503 sent. Consider increasing memory for current running application.");
return false;
}
}