Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1605#discussion_r146450966
--- Diff:
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/util/SyncCalculation.java
---
@@ -69,74 +171,55 @@ public static long syncTest(File datafolder,
file.close();
- long[] result = new long[tries];
+ final long[] elapsedMillis = new long[tries];
- byte[] block = new byte[blockSize];
-
- for (int i = 0; i < block.length; i++) {
- block[i] = (byte) 't';
- }
-
- ByteBuffer bufferBlock = factory.newBuffer(blockSize);
- bufferBlock.put(block);
- bufferBlock.position(0);
-
- final ReusableLatch latch = new ReusableLatch(0);
-
- IOCallback callback = new IOCallback() {
- @Override
- public void done() {
- latch.countDown();
- }
-
- @Override
- public void onError(int errorCode, String errorMessage) {
-
- }
- };
-
- DecimalFormat dcformat = new DecimalFormat("###.##");
+ final DecimalFormat dcformat = new DecimalFormat("###.##");
for (int ntry = 0; ntry < tries; ntry++) {
+ //perform a gc on each test iteration to help cleanup of
callbacks/garbage
+ System.gc();
--- End diff --
Not under production I mean. This is only used once to create the server.
Just leave it be.
---