Skip to content

Instantly share code, notes, and snippets.

View bjorndarri's full-sized avatar

Björn Darri Sigurðsson bjorndarri

View GitHub Profile
@bjorndarri
bjorndarri / JConsole8Test.java
Last active January 22, 2019 15:36
JConsole shows threads when run via ProcessBuilder from the process being monitored (Oracle jdk1.8.0_202_linux-x64)
import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.util.concurrent.Executors;
public class JConsole8Test {
public static void main(String[] args) throws IOException {
Executors.newSingleThreadExecutor(runnable -> new Thread(runnable, "JConsole8Test")).execute(() -> {
try {
@bjorndarri
bjorndarri / JConsole11Test.java
Created January 22, 2019 14:42
JConsole does not show threads when run via ProcessBuilder from the process being monitored (openjdk-11.0.2_linux-x64)
import java.io.File;
import java.io.IOException;
import java.util.concurrent.Executors;
public class JConsole11Test {
public static void main(String[] args) throws IOException {
Executors.newSingleThreadExecutor().execute(() -> {
try {
Thread.sleep(1000);