参考:https://blog.csdn.net/lom9357bye/article/details/133702169
public static void main(String[] args) throws Throwable {
new Thread(() -> {
ByteBuffer byteBuffer = ByteBuffer.allocateDirect(11);
byteBuffer.put(0, new byte[]{1,2,3}, 0, 3);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
System.out.println("over");
}).start();
Thread.sleep(3000);
System.gc();
System.out.println("over1");
}