2020年10月31日

ConcurrentHashMap扩容分析

摘要: CHM的扩容方法是 transfer ,发现调用该方法的地方一共有三处 tryPresize 在treeifyBin被调用,判断该数组节点相关元素是不是已经超过8个的时候,此时要判断桶的数量是不是超过了64个,如果还没超过就先扩容。如果超过则把链表转为树 helpTransfer 一个线程要对tab 阅读全文

posted @ 2020-10-31 21:23 MaXianZhe 阅读(189) 评论(0) 推荐(0) 编辑

ByteBuffer使用示例

摘要: ByteBuffer buffer = ByteBuffer.allocate(4+4 +name.length + address.length); buffer.putlnt(name.length) ; buffer.put(name) ; buffer.putlnt(address.leng 阅读全文

posted @ 2020-10-31 17:58 MaXianZhe 阅读(76) 评论(0) 推荐(0) 编辑

Synchronized代码小测试

摘要: 做本实验需要引入坐标 <dependency> <groupId>org.openjdk.jol</groupId> <artifactId>jol-core</artifactId> <version>0.9</version> </dependency> 先看一下我的代码 public stat 阅读全文

posted @ 2020-10-31 10:17 MaXianZhe 阅读(103) 评论(0) 推荐(0) 编辑

一篇不错的关于G1的文章搬运

摘要: 原文地址 https://zhuanlan.zhihu.com/p/52841787?from_voters_page=true G1 is planned as the long term replacement for the Concurrent Mark-Sweep Collector (C 阅读全文

posted @ 2020-10-31 09:18 MaXianZhe 阅读(258) 评论(0) 推荐(0) 编辑

导航