RFR: 6669: FlameGraphView tree calculation should (probably) be interruptable [v6]

Marcus Hirt hirt at openjdk.java.net
Sun Oct 25 19:31:37 UTC 2020


On Fri, 23 Oct 2020 14:25:51 GMT, Miroslav Wengner <mwengner at openjdk.org> wrote:

>> fix to bug: https://bugs.openjdk.java.net/browse/JMC-6669
>
> Miroslav Wengner has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision:
> 
>  - 6669: typo correction
>  - 6669: only last thread, cleaned
>  - Merge branch 'master' of https://github.com/openjdk/jmc into bugfix/6669_FlameGraphView_tree_calculation_should_probably_be_interruptable
>  - 6669: correction
>  - 6669: spotless needs
>  - 6669: more executor threads,runnable, canceling threads, cleanup
>  - 6669: correction
>  - 6669: spotless needs
>  - 6669: model calculation cancelation

application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java line 157:

> 155: 
> 156: 	private static final int MODEL_EXECUTOR_THREADS_NUMBER = 3;
> 157: 	private static final ExecutorService MODEL_EXECUTOR = Executors.newFixedThreadPool(MODEL_EXECUTOR_THREADS_NUMBER);

Perhaps add a thread factory to make it easier to interpret recordings?

	private static final ExecutorService MODEL_EXECUTOR = Executors.newFixedThreadPool(MODEL_EXECUTOR_THREADS_NUMBER, new ThreadFactory() {
		private ThreadGroup threadGroup = new ThreadGroup("FlameGraphModelCalculatorGroup");
		private AtomicInteger threadCounter = new AtomicInteger();
		@Override
		public Thread newThread(Runnable r) {
			Thread t = new Thread(threadGroup, r, "FlameGraphModelCalculator-" + threadCounter.getAndIncrement());
			t.setDaemon(true);
			return t;
		}
	});

-------------

PR: https://git.openjdk.java.net/jmc/pull/135


More information about the jmc-dev mailing list