Dear ngrinder developers..
So far there was no xmx and xms option in process execution. So.. I added the option depending on how many process is used for test test.
And I added -sever option to have more stabled JVM.
Following is the logic I added.
protected StringBuilder addMemorySettings(StringBuilder jvmArguments) {
String processCountStr = properties.getProperty("grinder.processes", "1");
int processCount = NumberUtils.toInt(processCountStr, 1);
long desirableXmx = DEFAULT_XMX_SIZE; // make 500M as default.
try {
// Make a room with 100MB.
long actualFree = new Sigar().getMem().getActualFree() - (100 * 1024 * 1024);
// If memory enough..
desirableXmx = actualFree / processCount;
if (desirableXmx < (DEFAULT_MIN_XMX_SIZE)) {
LOGGER.error("There is very few memory availble {}. It's not enough to run test", actualFree);
desirableXmx = DEFAULT_MIN_XMX_SIZE;
} else if (desirableXmx > DEFAULT_MAX_XMX_SIZE) {
desirableXmx = DEFAULT_MAX_XMX_SIZE;
}
} catch (SigarException e) {
LOGGER.error("Error occurs while calculating memory size", e);
desirableXmx = DEFAULT_XMX_SIZE;
}
return jvmArguments.append(" -Xms" + getMemorySizeStr(desirableXmx / 2) + "M -Xmx"
+ getMemorySizeStr(desirableXmx) + "M ");
}
Following is result.
Conclusion.
* -xms and -xms, -server option make the process excecution more stabled. Not much fluctuation..
* TPS goes up 15% more.
TPS Total 95.8
TPS Total 111.2
JunHo Yoon
Global Platform Development Lab / Senior Engineer