Loading...
TLAB(Thread Local Allocation Buffer) 线程本地分配缓存区由于对象一般分配在堆上,而堆是线程共用的,因此可能会有多个线程在堆上申请空间,而每一次的对象分配都必须加锁保证线程同步,会使分配的效率下降。考虑到对象分配几乎是 Java 中最常用的操作,因此 JVM 使用了 TLAB 这样的线程专有区域来避免多线程冲突,提高对象分配的效率。我们说 TLAB 是线程独...
接着上次 JVM 中 GC 机制的总结,这次主要复习一下垃圾收集的常用算法和 Minor GC、Full GC 相关的一些知识点。一、垃圾收集算法1.1 ...
在 JVM 运行时数据区域中,程序计数器、虚拟机栈和本地方法栈这三个区域属于线程私有的,只存在于线程的生命周期内,线程结束之后也会消失,因此不需要对这三个...
Java 的内存区域划分绝不仅仅只是堆内存(heap)和栈内存(Stack),实际上 JVM 在执行 Java 程序的过程中会把它所管理的内存划分为以下几个数据区域:程序计数器、Java 虚拟机栈、本地方法栈、堆、方法区、运行时常量和直接内存。如下图所示: