本文主要是介绍[笔记]DirectByteBuffer垃圾回收,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
参考: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");}
这篇关于[笔记]DirectByteBuffer垃圾回收的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!