Skip to content

Commit d04ea31

Browse files
committed
chore: add prettier config
1 parent 27eab34 commit d04ea31

File tree

9 files changed

+66
-45
lines changed

9 files changed

+66
-45
lines changed

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea/
2+
.github/
3+
node_modules/
4+
docs/.vuepress/

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"semi": true,
5+
"singleQuote": true,
6+
"trailingComma": "all",
7+
"bracketSpacing": true,
8+
"jsxBracketSameLine": false,
9+
"arrowParens": "avoid"
10+
}

docs/.vuepress/config.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
module.exports = {
2-
lang: "zh-CN",
3-
title: "JVM 底层原理最全知识总结",
4-
description: "Doocs开源社区",
2+
lang: 'zh-CN',
3+
title: 'JVM 底层原理最全知识总结',
4+
description: 'Doocs开源社区',
55
head: [
66
[
7-
"link",
7+
'link',
88
{
9-
rel: "icon",
10-
href: "https://avatars.githubusercontent.com/u/43716716?s=200&v=4",
9+
rel: 'icon',
10+
href: 'https://avatars.githubusercontent.com/u/43716716?s=200&v=4',
1111
},
1212
],
1313
],
14-
base: "/jvm/",
14+
base: '/jvm/',
1515
themeConfig: {
16-
repo: "doocs/jvm",
17-
logo: "https://avatars.githubusercontent.com/u/43716716?s=200&v=4",
16+
repo: 'doocs/jvm',
17+
logo: 'https://avatars.githubusercontent.com/u/43716716?s=200&v=4',
1818
open: true,
19-
contributorsText: "贡献者",
20-
docsDir: "docs",
21-
editLinkText: "编辑",
22-
lastUpdatedText: "最近更新时间",
19+
contributorsText: '贡献者',
20+
docsDir: 'docs',
21+
editLinkText: '编辑',
22+
lastUpdatedText: '最近更新时间',
2323
locales: {
24-
"/": {
25-
tip: "说明",
26-
warning: "注意",
27-
danger: "警告",
24+
'/': {
25+
tip: '说明',
26+
warning: '注意',
27+
danger: '警告',
2828
},
2929
},
3030
sidebar: [
3131
{
32-
text: "指南",
32+
text: '指南',
3333
children: [
34-
"/00-quickstart.md",
35-
"/01-jvm-memory-structure.md",
36-
"/02-hotspot-jvm-object.md",
37-
"/03-gc-algorithms.md",
38-
"/04-hotspot-gc.md",
39-
"/05-memory-allocation-gc.md",
40-
"/06-jvm-performance-tuning.md",
41-
"/07-class-structure.md",
42-
"/08-load-class-time.md",
43-
"/09-load-class-process.md",
44-
"/10-class-loader.md",
34+
'/00-quickstart.md',
35+
'/01-jvm-memory-structure.md',
36+
'/02-hotspot-jvm-object.md',
37+
'/03-gc-algorithms.md',
38+
'/04-hotspot-gc.md',
39+
'/05-memory-allocation-gc.md',
40+
'/06-jvm-performance-tuning.md',
41+
'/07-class-structure.md',
42+
'/08-load-class-time.md',
43+
'/09-load-class-process.md',
44+
'/10-class-loader.md',
4545
],
4646
},
4747
],
4848
},
4949
plugins: [
5050
[
51-
"@vuepress/plugin-search",
51+
'@vuepress/plugin-search',
5252
{
53-
isSearchable: (page) => page.path !== "/",
53+
isSearchable: page => page.path !== '/',
5454
},
5555
],
5656
],

docs/01-jvm-memory-structure.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ Java 中任何一个普通方法都具备虚函数的特征(运行期确认,
140140

141141
![jvm-memory](https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/jvm@main/images/jvm-memory.png)
142142

143-
144-
145143
### 堆的特点
146144

147145
- 线程共享,整个 Java 虚拟机只有一个堆,所有的线程都访问同一个堆。而程序计数器、Java 虚拟机栈、本地方法栈都是一个线程对应一个。
@@ -286,6 +284,4 @@ Java 虚拟机规范中定义方法区是堆的一个逻辑部分。方法区存
286284

287285
> 服务器管理员在配置虚拟机参数时,会根据实际内存设置`-Xmx`等参数信息,但经常忽略直接内存,使得各个内存区域总和大于物理内存限制,从而导致动态扩展时出现`OutOfMemoryError`异常。
288286
289-
290-
291287
> ![jvm-off-heap-memory](https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/jvm@main/images/jvm-off-heap-memory.png)

docs/02-hotspot-jvm-object.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ HotSpot VM 的自动内存管理系统要求对象的大小必须是 8 字节的
5959

6060
至此,整个对象的创建过程就完成了。
6161

62-
63-
6462
## 对象的访问方式
6563

6664
所有对象的存储空间都是在堆中分配的,但是这个对象的引用却是在堆栈中分配的。也就是说在建立一个对象时两个地方都分配内存,在堆中分配的内存实际建立这个对象,而在堆栈中分配的内存只是一个指向这个堆对象的指针(引用)而已。 那么根据引用存放的地址类型的不同,对象有不同的访问方式。

docs/03-gc-algorithms.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ GC Roots 并不包括堆中对象所引用的对象,这样就不会有循环
5959

6060
![](https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/jvm@main/images/finalize-method-process.jpg)
6161

62-
63-
6462
JVM 会判断此对象是否有必要执行 finalize() 方法,如果对象没有覆盖 finalize() 方法,或者 finalize() 方法已经被虚拟机调用过,那么视为“没有必要执行”。那么对象基本上就真的被回收了。
6563

6664
如果对象被判定为有必要执行 finalize() 方法,那么对象会被放入一个 F-Queue 队列中,虚拟机会以较低的优先级执行这些 finalize()方法,但不会确保所有的 finalize() 方法都会执行结束。如果 finalize() 方法出现耗时操作,虚拟机就直接停止指向该方法,将对象清除。
@@ -71,8 +69,6 @@ JVM 会判断此对象是否有必要执行 finalize() 方法,如果对象没
7169

7270
> 任何一个对象的 finalize() 方法只会被系统自动调用一次,如果对象面临下一次回收,它的 finalize() 方法不会被再次执行,想继续在 finalize() 中自救就失效了。
7371
74-
75-
7672
## 回收方法区内存
7773

7874
方法区中存放生命周期较长的类信息、常量、静态变量,每次垃圾收集只有少量的垃圾被清除。方法区中主要清除两种垃圾:

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"@vuepress/plugin-search": "2.0.0-beta.49",
14+
"prettier": "2.8.8",
1415
"vuepress": "2.0.0-beta.49"
1516
},
1617
"repository": {

vercel.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"github": {
3-
"silent": true
4-
}
5-
}
2+
"github": {
3+
"silent": true
4+
}
5+
}

0 commit comments

Comments
 (0)