Skip to content

Commit

Permalink
jvm
Browse files Browse the repository at this point in the history
  • Loading branch information
itwanger committed Mar 27, 2022
1 parent e789512 commit b714e35
Show file tree
Hide file tree
Showing 346 changed files with 3,022 additions and 598 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,16 @@

## 城市选择

- [北京都有哪些牛逼的互联网公司?](https://mp.weixin.qq.com/s/xlPZfpd89rDq6L-Me80wnw)
- [广州都有哪些牛逼的互联网公司?](https://mp.weixin.qq.com/s/uZQ8p0ytsQFXzt5ppzx6fA)
- [深圳有哪些牛批的互联网公司?](https://mp.weixin.qq.com/s/hBU-eEUq8aN5PWwdZFmC4g)
- [西安有哪些不错的互联网公司?](https://mp.weixin.qq.com/s/s0Ub1CHC9eEi0YrqPrnRog)
- [青岛有牛逼的互联网公司吗?](https://mp.weixin.qq.com/s/8QQvOrkG3Vdjj3GxP1zxBQ)
- [郑州有哪些不错的互联网公司?](https://mp.weixin.qq.com/s/SU9drg2xJKcheIwJ6OSSBQ)
- [苏州有哪些牛逼的互联网公司?](https://mp.weixin.qq.com/s/cnYsZLudFOwv5EKYMsMh0Q)
- [南京有哪些靠谱的互联网公司?](https://mp.weixin.qq.com/s/CfZ1CEmtPOP4TAwAs8Ocrw)
- [杭州有哪些顶级的互联网公司?](https://mp.weixin.qq.com/s/hrL2tqXHT5AjOqrQlRhR-w)
- [成都有哪些顶级的互联网公司](https://mp.weixin.qq.com/s/eaX9QhLwy_VsGIH0apA4qw)
- [北京都有哪些牛逼的互联网公司?](docs/cityselect/beijing.md)
- [想去广州了!](docs/cityselect/guangzhou.md)
- [深圳有哪些牛批的互联网公司?](docs/cityselect/shenzhen.md)
- [西安有哪些不错的互联网公司?](docs/cityselect/xian.md)
- [青岛有牛逼的互联网公司吗?](docs/cityselect/qingdao.md)
- [郑州有哪些不错的互联网公司?](docs/cityselect/zhengzhou.md)
- [想搬去苏州生活了。。](docs/cityselect/suzhou.md)
- [南京有哪些靠谱的互联网公司?](docs/cityselect/nanjing.md)
- [杭州有哪些顶级的互联网公司?](docs/cityselect/hangzhou.md)
- [成都有哪些牛批的互联网公司](docs/cityselect/chengdu.md)

## 工作体会

Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default defineHopeConfig({
"link",
{
rel: "stylesheet",
href: "//at.alicdn.com/t/font_3180624_5ghp44hvotu.css",
href: "//at.alicdn.com/t/font_3180624_f9ua2hfjypv.css",
},
],
],
Expand Down
37 changes: 36 additions & 1 deletion docs/.vuepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,26 @@ export const sidebarConfig = defineSidebarConfig({
{
text: "Java虚拟机",
icon: "JVM",
prefix: "jvm/",
collapsable: true,
children: [
"jvm/what-is-jvm",
"what-is-jvm",
"how-run-java-code",
"class-load",
"class-file-jiegou",
"bytecode",
"zijiema-zhiling",
"how-jvm-run-zijiema-zhiling",
"hsdb",
"asm",
"compile-jdk",
"neicun-jiegou",
"whereis-the-object",
"gc",
"tujie-gc",
"problem-tools",
"jit",
"zongjie",
],
},
],
Expand Down Expand Up @@ -413,6 +430,24 @@ export const sidebarConfig = defineSidebarConfig({
"sidebar/herongwei/mysql",
],
},
{
text: "城市选择",
icon: "chengshi",
prefix: "cityselect/",
collapsable: true,
children: [
"beijing",
"chengdu",
"guangzhou",
"hangzhou",
"nanjing",
"qingdao",
"shenzhen",
"suzhou",
"xian",
"zhengzhou",
],
},
],
},
{
Expand Down
2 changes: 2 additions & 0 deletions docs/array/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,5 @@ int index = Arrays.binarySearch(anArray, 4);
```

“除了一维数组,还有二维数组,三妹你可以去研究下,比如说用二维数组打印一下杨辉三角。”说完,我就去阳台上休息了,留三妹在那里学习,不能打扰她。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
2 changes: 1 addition & 1 deletion docs/array/print.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ System.out.println(Arrays.deepToString(deepArray));

“OK,我走,我走。”


<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
4 changes: 3 additions & 1 deletion docs/baguwen/java-basic-34.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tag:
- 面试题集合
---

# Java:34道精选高频面试题
# Java:34道精选高频面试题必看:+1:

## 1.介绍一下 java 吧

Expand Down Expand Up @@ -566,3 +566,5 @@ Object obj = new Object();
- **4.Padding**:Java 对象占用空间是 8 字节对齐的,即所有 Java 对象占用 bytes 数必须是 8 的倍数,是因为当我们从磁盘中取一个数据时,不会说我想取一个字节就是一个字节,都是按照一块儿一块儿来取的,这一块大小是 8 个字节,所以为了完整,padding 的作用就是补充字节,**保证对象是 8 字节的整数倍**

---

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
7 changes: 5 additions & 2 deletions docs/baguwen/java-basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,5 +396,8 @@ equals 和 hashCode 这两个方法都是从 object 类中继承过来的,equa

---

作者:后端技术小牛说
链接:https://mp.weixin.qq.com/s/PmeH38qWVxyIhBpsAsjG7w
投稿作者:后端技术小牛说
转载链接:[https://mp.weixin.qq.com/s/PmeH38qWVxyIhBpsAsjG7w](https://mp.weixin.qq.com/s/PmeH38qWVxyIhBpsAsjG7w)


<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
7 changes: 4 additions & 3 deletions docs/baguwen/java-thread.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ tag:

# Java 并发编程八股文(背诵版)必看:+1:


### 简述Java内存模型(JMM)
Java内存模型定义了程序中各种变量的访问规则:

Expand Down Expand Up @@ -300,5 +299,7 @@ AQS获取共享锁/释放共享锁原理
----


作者:后端技术小牛说
链接:https://mp.weixin.qq.com/s/HEzi-UKs-hpWhTh_HPWaMQ
投稿作者:后端技术小牛说
转载链接:[https://mp.weixin.qq.com/s/PmeH38qWVxyIhBpsAsjG7w](https://mp.weixin.qq.com/s/PmeH38qWVxyIhBpsAsjG7w)

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
6 changes: 4 additions & 2 deletions docs/baguwen/jvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,7 @@ MinorGC 前,虚拟机必须检查老年代最大可用连续空间是否大于
----


作者:后端技术小牛说
链接:https://mp.weixin.qq.com/s/2cLVDLcOQTdV4BGAv1XEuw
投稿作者:后端技术小牛说
转载链接:[https://mp.weixin.qq.com/s/PmeH38qWVxyIhBpsAsjG7w](https://mp.weixin.qq.com/s/PmeH38qWVxyIhBpsAsjG7w)

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
5 changes: 4 additions & 1 deletion docs/basic-extra-meal/48-keywords.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,7 @@ PS:按照首字母的自然顺序排列。

“好了,三妹,关于 Java 中的关键字就先说这 48 个吧,这只是一个大概的介绍,后面还会对一些特殊的关键字单独拎出来详细地讲,比如说重要的 static、final 等。”转动了一下僵硬的脖子后,我对三妹说。

“二哥,你辛苦了,足足 48 个啊,容我好好消化一下。”
“二哥,你辛苦了,足足 48 个啊,容我好好消化一下。”

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png">

2 changes: 2 additions & 0 deletions docs/basic-extra-meal/Overriding.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,5 @@ synchronized 关键字用于在多线程环境中获取和释放监听对象,
**规则十一:strictfp 关键字对重写规则没有任何影响**

如果你想让浮点运算更加精确,而且不会因为硬件平台的不同导致执行的结果不一致的话,可以在方法上添加 strictfp 关键字。因此 strictfp 关键和重写规则无关。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
2 changes: 2 additions & 0 deletions docs/basic-extra-meal/annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,5 @@ public class JsonFieldTest {
“撸个注解好像真没什么难度,但你接下来的那个 JsonSerializer 我还需要再消化一下。”三妹很认真地说。

“嗯,你好好复习下,我看会《编译原理》。”说完我拿起桌子边上的一本书就走了。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
1 change: 1 addition & 0 deletions docs/basic-extra-meal/box.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,4 @@ System.out.println(t2-t1);

“好了,三妹,今天的主题就先讲到这吧。我再去来根华子。”

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
5 changes: 4 additions & 1 deletion docs/basic-extra-meal/comparable-omparator.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,7 @@ for (Cmower c : list) {
------


好了,关于 Comparable 和 Comparator 我们就先聊这么多。总而言之,如果对象的排序需要基于自然顺序,请选择 `Comparable`,如果需要按照对象的不同属性进行排序,请选择 `Comparator`
好了,关于 Comparable 和 Comparator 我们就先聊这么多。总而言之,如果对象的排序需要基于自然顺序,请选择 `Comparable`,如果需要按照对象的不同属性进行排序,请选择 `Comparator`


<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
2 changes: 2 additions & 0 deletions docs/basic-extra-meal/deep-copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,3 +422,5 @@ writer2:Writer@544fe44c age=18, name='二哥', book=Book@31610302 bookName='
“好的,二哥,你先去休息吧,让我来琢磨一会,总结一下浅拷贝和深拷贝之间的差异。”

“嗯嗯。”

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
2 changes: 2 additions & 0 deletions docs/basic-extra-meal/enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,5 @@ public enum EasySingleton{
“好勒,这就安排。二哥,你去休息吧。”

“嗯嗯。”讲了这么多,必须跑去抽烟机那里安排一根华子了。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
1 change: 1 addition & 0 deletions docs/basic-extra-meal/equals-hashcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,4 @@ result = (31*1 + Integer(18).hashCode()) * 31 + String("张三").hashCode();

“OK,get 了。”三妹开心地点了点头,看得出来,今天学到了不少。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
2 changes: 1 addition & 1 deletion docs/basic-extra-meal/fanshe.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,5 @@ Method[] methods2 = System.class.getMethods();

>链接:https://www.cnblogs.com/chanshuyi/p/head_first_of_reflection.html

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">

2 changes: 1 addition & 1 deletion docs/basic-extra-meal/generic.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,4 @@ list3.add(new Wangxiaoer());

“好的,二哥。”


<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
2 changes: 2 additions & 0 deletions docs/basic-extra-meal/hashcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,5 @@ static inline intptr_t get_next_hash(Thread* current, oop obj) {
- `hashCode == 3`,从 0 开始计算哈希值,不是线程安全的,多个线程可能会得到相同的哈希值。
- `hashCode == 4`,与创建对象的内存位置有关,原样输出。
- `hashCode == 5`,默认值,支持多线程,使用了 Marsaglia 的 xor-shift 算法产生伪随机数。所谓的 xor-shift 算法,简单来说,看起来就是一个移位寄存器,每次移入的位由寄存器中若干位取异或生成。所谓的伪随机数,不是完全随机的,但是真随机生成比较困难,所以只要能通过一定的随机数统计检测,就可以当作真随机数来使用。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
1 change: 1 addition & 0 deletions docs/basic-extra-meal/immutable.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,4 @@ public Book getBook() {

不可变类有很多优点,就像之前提到的 String 类那样,尤其是在多线程环境下,它非常的安全。尽管每次修改都会创建一个新的对象,增加了内存的消耗,但这个缺点相比它带来的优点,显然是微不足道的——无非就是捡了西瓜,丢了芝麻。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
1 change: 1 addition & 0 deletions docs/basic-extra-meal/int-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,4 @@ Exception in thread "main" java.lang.AssertionError

“get 了!二哥你真棒,又学到了。”三妹很开心~

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
4 changes: 1 addition & 3 deletions docs/basic-extra-meal/java-naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,4 @@ Service/DAO 层的方法命名规约:

-----

**Java 程序员进阶之路**》预计一个月左右会有一次内容更新和完善,大家在我的公众号 **沉默王二** 后台回复“**03**” 即可获取最新版!如果觉得内容不错的话,欢迎转发分享!

<img src="https://cdn.jsdelivr.net/gh/itwanger/toBeBetterJavaer/images/itwanger.png" alt="图片没显示的话,可以微信搜索「沉默王二」关注" style="zoom:50%;" />
<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
4 changes: 3 additions & 1 deletion docs/basic-extra-meal/java-unicode.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,6 @@ UTF-16 使用 2 个或者 4 个字节来存储字符。



“好了,三妹,关于 Unicode 就先说这么多吧,你是不是已经清楚了?”转动了一下僵硬的脖子后,我对三妹说。
“好了,三妹,关于 Unicode 就先说这么多吧,你是不是已经清楚了?”转动了一下僵硬的脖子后,我对三妹说。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
2 changes: 2 additions & 0 deletions docs/basic-extra-meal/jdk-while-for-wuxian-xunhuan.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ public void bar() {
所以,牛逼之人必有三连之处啊。

以后就可以放心大胆在代码里写 `for(;;) while(true)` 这样的死循环了。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
2 changes: 2 additions & 0 deletions docs/basic-extra-meal/jdk9-char-byte-string.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,5 @@ Java 会根据字符串的内容自动设置为相应的编码,要么 Latin-1
所以UTF-16在Java的世界里,就可以视为一个定长的编码。

>参考链接:https://www.zhihu.com/question/447224628
<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
4 changes: 3 additions & 1 deletion docs/basic-extra-meal/override-overload.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,6 @@ class Vehicle {

“‘一大’:子类方法的访问权限应该比父类的更大或者相等。”

“记住了吧?三妹。带上口罩,拿好手机,咱准备出门吧。”今天限号,没法开车送三妹去学校了。
“记住了吧?三妹。带上口罩,拿好手机,咱准备出门吧。”今天限号,没法开车送三妹去学校了。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
2 changes: 1 addition & 1 deletion docs/basic-extra-meal/pass-by-value.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ class ReferenceTypeDemo {




<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">

4 changes: 3 additions & 1 deletion docs/basic-extra-meal/true-generic.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,6 @@ Project Valhalla:正在进行当中的 OpenJDK 项目,计划给未来的 Jav

“怎么样?三妹,这下全部都明白了吧!”我问。

“嗯嗯。二哥,你讲得可真棒👍”三妹夸奖得我有点小开心,嘿嘿。
“嗯嗯。二哥,你讲得可真棒👍”三妹夸奖得我有点小开心,嘿嘿。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
1 change: 1 addition & 0 deletions docs/basic-extra-meal/varables.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,4 @@ public static void print(Integer... ints) {
上面这段代码是可以编译通过的。因为编译器知道参数是 String 类型还是 Integer 类型,只不过为了运行时不抛出 `NullPointerException`,两个 `print()` 方法的内部要做好判空操作。


<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
4 changes: 3 additions & 1 deletion docs/basic-grammar/basic-data-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,6 @@ public class ArrayList<E> extends AbstractList<E>

这么说就理解了吧?

“好了,三妹,关于 Java 中的数据类型就先说这么多吧,你是不是已经清楚了?”转动了一下僵硬的脖子后,我对三妹说。
“好了,三妹,关于 Java 中的数据类型就先说这么多吧,你是不是已经清楚了?”转动了一下僵硬的脖子后,我对三妹说。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
1 change: 1 addition & 0 deletions docs/basic-grammar/flow-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -906,3 +906,4 @@ public class ContinueDoWhileDemo {

注意:同样的,如果把 if 条件中的“i++”省略掉的话,程序就会进入死循环,一直在 continue。

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
4 changes: 1 addition & 3 deletions docs/basic-grammar/javadoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,4 @@ public class Test {
-----

**Java 程序员进阶之路**》预计一个月左右会有一次内容更新和完善,大家在我的公众号 **沉默王二** 后台回复“**03**” 即可获取最新版!如果觉得内容不错的话,欢迎转发分享!

<img src="https://cdn.jsdelivr.net/gh/itwanger/toBeBetterJavaer/images/itwanger.png" alt="图片没显示的话,可以微信搜索「沉默王二」关注" style="zoom:50%;" />
<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
4 changes: 3 additions & 1 deletion docs/basic-grammar/operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,6 @@ public class TernaryOperator {

“好了,三妹,关于 Java 运算符就先说这么多吧,你是不是已经清楚了?”转动了一下僵硬的脖子后,我对三妹说。

“差不多,二哥,我需要写点 demo 练习会。”
“差不多,二哥,我需要写点 demo 练习会。”

<img src="http://cdn.tobebetterjavaer.com/tobebetterjavaer/images/xingbiaogongzhonghao.png" width="700px">
Loading

0 comments on commit b714e35

Please sign in to comment.