use of com.thoughtworks.go.util.command.InMemoryStreamConsumer in project gocd by gocd.
the class PipelineConfigServicePerformanceTest method takeHeapDump.
private void takeHeapDump(int i) {
InMemoryStreamConsumer outputStreamConsumer = inMemoryConsumer();
CommandLine commandLine = CommandLine.createCommandLine("jmap").withArgs("-J-d64", String.format("-dump:format=b,file=%s/%s.hprof", tempDir.toFile().getAbsoluteFile(), i), ManagementFactory.getRuntimeMXBean().getName().split("@")[0]);
LOGGER.info(commandLine.describe());
int exitCode = commandLine.run(outputStreamConsumer, new NamedProcessTag("thread" + i));
LOGGER.info(outputStreamConsumer.getAllOutput());
assertThat(exitCode, is(0));
LOGGER.info("Heap dump available at " + tempDir.toFile().getAbsolutePath());
}
Aggregations