java
文章平均质量分 92
话不投机头打歪
这个作者很懒,什么都没留下…
展开
-
Spring@EnableAsync和@Async异步方法调用实践和原理分析,@Async失效问题
@EnableAsync是什么?有什么作用?代码示例://这里开启异步支持@EnableAsyncpublic class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); }}@Componentpublic class LogService { //标记这个方法为异步方法 @Async public v原创 2020-08-14 09:15:03 · 654 阅读 · 0 评论 -
JVM的垃圾回收器(GC)
1.堆内存模型1.分带收集的垃圾回收器1.1新生带1.1.1Serial1.1.2ParNew1.1.3Parallel Scavenge1.2老年代1.2.1Serial Old1.2.2CMS1.2.3Parallel Old内存溢出定位原创 2020-06-07 13:17:48 · 144 阅读 · 0 评论 -
synchronized锁升级过程
JAVA虚拟机堆synchronized的优化对象头与monitorMarkWord区是存在在JAVA对象头中的一个区域大小为8字节里面包含了1.锁信息2.GC信息3.HashCode(如果有调用)public class Demo1 { public static void main(String[] args) throws IOException { Object o = new Object(); System.out.println(Clas原创 2020-05-29 21:39:15 · 609 阅读 · 1 评论 -
结合官方《JAVA虚拟机规范》来验证JVM中运行时常量池的存放位置
3.5.5 Runtime Constant PoolA runtime constant pool is a per-class or per-interface runtime representation of the constant_pool table in a class file (§4.4). It contains several kinds of constants, ranging from numeric literals known at compile time to met原创 2020-05-29 14:52:24 · 279 阅读 · 0 评论