@Override
	public void run() {
		for (AgentStatus agentStates : agentManager.getAttachedAgentStatusSetConnectingToPort(singleConsole.getConsolePort())) {
			SystemDataModel systemDataModel = agentStates.getSystemDataModel();
			if (systemDataModel != null) {
				// If the memory is available less than 2%.
				double freeMemoryRatio = ((double) systemDataModel.getFreeMemory()) / systemDataModel.getTotalMemory();
				if (freeMemoryRatio < 0.02) {
					if (perfTest.getStatus() != Status.ABNORMAL_TESTING) {
						perfTestService.markStatusAndProgress(perfTest, Status.ABNORMAL_TESTING, //
								String.format("[ERROR] %s agent is about to die due to lack of free memory.\n"
										+ "Shutdown PerfTest %s by force for safety\n" + "Please decrease the vuser count.", //
										agentStates.getAgentName(), perfTest.getId()));
					}
				}
			}
		}
	}
Constructor.

@param singleConsole   singleConsole to monitor
@param perfTest        perfTest which this sampling start
@param perfTestService perfTestService
@param agentManager    agent manager
ngrinder-controller/src/main/java/org/ngrinder/perftest/service/samplinglistener/AgentDieHardListener.java