diff --git a/.idea/libraries/ObjectSize.xml b/.idea/libraries/ObjectSize.xml
deleted file mode 100644
index d7060cd..0000000
--- a/.idea/libraries/ObjectSize.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index d5d79e0..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index a1fe7b5..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100644
index 830e00a..0000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,944 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- init
- getSystem
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1561013618757
-
-
- 1561013618757
-
-
- 1572139204079
-
-
-
- 1572139204080
-
-
- 1572751959550
-
-
-
- 1572751959551
-
-
- 1573356973402
-
-
-
- 1573356973402
-
-
- 1573978371366
-
-
-
- 1573978371366
-
-
- 1574565250892
-
-
-
- 1574565250892
-
-
- 1575797727420
-
-
-
- 1575797727421
-
-
- 1576293676126
-
-
-
- 1576293676126
-
-
- 1577020821757
-
-
-
- 1577020821757
-
-
- 1578712891871
-
-
-
- 1578712891871
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- No facets are configured
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
- JVM
-
-
-
-
-
-
-
-
-
-
-
- ObjectSize
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/03_01_JMM.md b/03_01_JMM.md
index 985f918..e050159 100644
--- a/03_01_JMM.md
+++ b/03_01_JMM.md
@@ -11,6 +11,7 @@ https://www.cnblogs.com/z00377750/p/9180644.html
现代CPU的数据一致性实现 = 缓存锁(MESI ...) + 总线锁
读取缓存以cache line为基本单位,目前64bytes
+(缓存行可以想到内存对齐的问题,组成原理里的)
位于同一缓存行的两个不同数据,被两个不同CPU锁定,产生互相影响的伪共享问题
diff --git a/JVM.iml b/JVM.iml
deleted file mode 100644
index c35ba57..0000000
--- a/JVM.iml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/out/production/JVM/com/mashibing/jvm/ConstantPoolOOM.class b/out/production/JVM/com/mashibing/jvm/ConstantPoolOOM.class
deleted file mode 100644
index f5bfeb4..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/ConstantPoolOOM.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/ExeModeCompVSMixed.class b/out/production/JVM/com/mashibing/jvm/ExeModeCompVSMixed.class
deleted file mode 100644
index 3874df1..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/ExeModeCompVSMixed.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/HeapOOM.class b/out/production/JVM/com/mashibing/jvm/HeapOOM.class
deleted file mode 100644
index 5e72b7e..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/HeapOOM.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/Hello.class b/out/production/JVM/com/mashibing/jvm/Hello.class
deleted file mode 100644
index aa5dd6c..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/Hello.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/StackOverFlow.class b/out/production/JVM/com/mashibing/jvm/StackOverFlow.class
deleted file mode 100644
index 1808099..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/StackOverFlow.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/TestGC.class b/out/production/JVM/com/mashibing/jvm/TestGC.class
deleted file mode 100644
index 41e9ee7..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/TestGC.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c0_basic/T.class b/out/production/JVM/com/mashibing/jvm/c0_basic/T.class
deleted file mode 100644
index 5264796..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c0_basic/T.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c0_basic/TestIndentityHashCode$1.class b/out/production/JVM/com/mashibing/jvm/c0_basic/TestIndentityHashCode$1.class
deleted file mode 100644
index 26a0af4..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c0_basic/TestIndentityHashCode$1.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c0_basic/TestIndentityHashCode$T.class b/out/production/JVM/com/mashibing/jvm/c0_basic/TestIndentityHashCode$T.class
deleted file mode 100644
index 98fed0c..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c0_basic/TestIndentityHashCode$T.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c0_basic/TestIndentityHashCode.class b/out/production/JVM/com/mashibing/jvm/c0_basic/TestIndentityHashCode.class
deleted file mode 100644
index 4754cbd..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c0_basic/TestIndentityHashCode.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0100_ByteCode01.class b/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0100_ByteCode01.class
deleted file mode 100644
index 4155248..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0100_ByteCode01.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0101_ByteCode_With_Interfaces.class b/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0101_ByteCode_With_Interfaces.class
deleted file mode 100644
index 575c180..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0101_ByteCode_With_Interfaces.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0102_ByteCode02.class b/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0102_ByteCode02.class
deleted file mode 100644
index 7550ec6..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0102_ByteCode02.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0103_ByteCode03.class b/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0103_ByteCode03.class
deleted file mode 100644
index 9862a69..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0103_ByteCode03.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0104_ByteCode04.class b/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0104_ByteCode04.class
deleted file mode 100644
index eed2529..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0104_ByteCode04.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0104_ByteCode05.class b/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0104_ByteCode05.class
deleted file mode 100644
index 390ed0d..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c1_bytecode/T0104_ByteCode05.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T.class
deleted file mode 100644
index 5fd1053..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T001_ClassLoadingProcedure.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T001_ClassLoadingProcedure.class
deleted file mode 100644
index 95322cd..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T001_ClassLoadingProcedure.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T002_ClassLoaderLevel.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T002_ClassLoaderLevel.class
deleted file mode 100644
index 1be7d68..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T002_ClassLoaderLevel.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T003_ClassLoaderScope.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T003_ClassLoaderScope.class
deleted file mode 100644
index f4b6711..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T003_ClassLoaderScope.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T004_ParentAndChild.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T004_ParentAndChild.class
deleted file mode 100644
index 6e16f8a..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T004_ParentAndChild.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T005_LoadClassByHand.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T005_LoadClassByHand.class
deleted file mode 100644
index 9fc5aad..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T005_LoadClassByHand.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T006_MSBClassLoader.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T006_MSBClassLoader.class
deleted file mode 100644
index 91ec263..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T006_MSBClassLoader.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T007_MSBClassLoaderWithEncription.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T007_MSBClassLoaderWithEncription.class
deleted file mode 100644
index 169ea49..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T007_MSBClassLoaderWithEncription.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T008_LazyLoading$P.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T008_LazyLoading$P.class
deleted file mode 100644
index d3fb65e..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T008_LazyLoading$P.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T008_LazyLoading$X.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T008_LazyLoading$X.class
deleted file mode 100644
index 3e4dd5b..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T008_LazyLoading$X.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T008_LazyLoading.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T008_LazyLoading.class
deleted file mode 100644
index fa34701..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T008_LazyLoading.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T009_WayToRun.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T009_WayToRun.class
deleted file mode 100644
index dc45be2..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T009_WayToRun.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T010_Parent$MyLoader.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T010_Parent$MyLoader.class
deleted file mode 100644
index 26b9c76..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T010_Parent$MyLoader.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T010_Parent.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T010_Parent.class
deleted file mode 100644
index 047ceb1..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T010_Parent.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T011_ClassReloading1.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T011_ClassReloading1.class
deleted file mode 100644
index 1178f9b..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T011_ClassReloading1.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T012_ClassReloading2$1.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T012_ClassReloading2$1.class
deleted file mode 100644
index f026ecb..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T012_ClassReloading2$1.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T012_ClassReloading2$MyLoader.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T012_ClassReloading2$MyLoader.class
deleted file mode 100644
index 2a3c664..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T012_ClassReloading2$MyLoader.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c2_classloader/T012_ClassReloading2.class b/out/production/JVM/com/mashibing/jvm/c2_classloader/T012_ClassReloading2.class
deleted file mode 100644
index 7877dfa..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c2_classloader/T012_ClassReloading2.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/T02_PrintMemoryInfo.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/T02_PrintMemoryInfo.class
deleted file mode 100644
index 008b24e..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/T02_PrintMemoryInfo.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject$1.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject$1.class
deleted file mode 100644
index 14d461f..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject$1.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject$P.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject$P.class
deleted file mode 100644
index 5534c39..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject$P.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject.class
deleted file mode 100644
index 6f8c8e7..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/T04_Disorder$1.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/T04_Disorder$1.class
deleted file mode 100644
index cdb6895..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/T04_Disorder$1.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/T04_Disorder$2.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/T04_Disorder$2.class
deleted file mode 100644
index 2c96784..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/T04_Disorder$2.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/T04_Disorder.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/T04_Disorder.class
deleted file mode 100644
index ef262ec..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/T04_Disorder.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/TestHeapDump.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/TestHeapDump.class
deleted file mode 100644
index b572336..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/TestHeapDump.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/TestSync.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/TestSync.class
deleted file mode 100644
index 0c1f60b..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/TestSync.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/c3_jmm/TestVolatile.class b/out/production/JVM/com/mashibing/jvm/c3_jmm/TestVolatile.class
deleted file mode 100644
index 0930733..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/c3_jmm/TestVolatile.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/cms/Student.class b/out/production/JVM/com/mashibing/jvm/cms/Student.class
deleted file mode 100644
index 13620ce..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/cms/Student.class and /dev/null differ
diff --git a/out/production/JVM/com/mashibing/jvm/cms/Test.class b/out/production/JVM/com/mashibing/jvm/cms/Test.class
deleted file mode 100644
index 0f73009..0000000
Binary files a/out/production/JVM/com/mashibing/jvm/cms/Test.class and /dev/null differ
diff --git a/src/com/mashibing/jvm/c2_classloader/T007_MSBClassLoaderWithEncription.java b/src/com/mashibing/jvm/c2_classloader/T007_MSBClassLoaderWithEncription.java
index 5ae8608..a9a4212 100644
--- a/src/com/mashibing/jvm/c2_classloader/T007_MSBClassLoaderWithEncription.java
+++ b/src/com/mashibing/jvm/c2_classloader/T007_MSBClassLoaderWithEncription.java
@@ -7,6 +7,9 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
+/**
+ * 自定义classloader 并加密,防止别人反编译
+ */
public class T007_MSBClassLoaderWithEncription extends ClassLoader {
public static int seed = 0B10110110;
diff --git a/src/com/mashibing/jvm/c2_classloader/T010_Parent.java b/src/com/mashibing/jvm/c2_classloader/T010_Parent.java
index a5eff2f..d04cd53 100644
--- a/src/com/mashibing/jvm/c2_classloader/T010_Parent.java
+++ b/src/com/mashibing/jvm/c2_classloader/T010_Parent.java
@@ -1,5 +1,8 @@
package com.mashibing.jvm.c2_classloader;
+/**
+ * 指定父classloader
+ */
public class T010_Parent {
private static T006_MSBClassLoader parent = new T006_MSBClassLoader();
diff --git a/src/com/mashibing/jvm/c2_classloader/T011_ClassReloading1.java b/src/com/mashibing/jvm/c2_classloader/T011_ClassReloading1.java
index 9226f1f..7c4f758 100644
--- a/src/com/mashibing/jvm/c2_classloader/T011_ClassReloading1.java
+++ b/src/com/mashibing/jvm/c2_classloader/T011_ClassReloading1.java
@@ -1,5 +1,8 @@
package com.mashibing.jvm.c2_classloader;
+/**
+ * 本类并未破坏双亲委派
+ */
public class T011_ClassReloading1 {
public static void main(String[] args) throws Exception {
T006_MSBClassLoader msbClassLoader = new T006_MSBClassLoader();
diff --git a/src/com/mashibing/jvm/c2_classloader/T012_ClassReloading2.java b/src/com/mashibing/jvm/c2_classloader/T012_ClassReloading2.java
index aedc23c..c48ed99 100644
--- a/src/com/mashibing/jvm/c2_classloader/T012_ClassReloading2.java
+++ b/src/com/mashibing/jvm/c2_classloader/T012_ClassReloading2.java
@@ -1,20 +1,24 @@
package com.mashibing.jvm.c2_classloader;
-import com.mashibing.jvm.Hello;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.net.URL;
+/**
+ * 本类破坏了双亲委派模型
+ * 打破双亲委派,只能重写loadclass
+ */
public class T012_ClassReloading2 {
private static class MyLoader extends ClassLoader {
@Override
public Class> loadClass(String name) throws ClassNotFoundException {
-
- File f = new File("C:/work/ijprojects/JVM/out/production/JVM/" + name.replace(".", "/").concat(".class"));
-
- if(!f.exists()) return super.loadClass(name);
+ String filePath = getCurrentClassPath() + File.separator + name.replaceAll("\\.", File.separator).concat(".class");
+ File f = new File(filePath);
+ if (!f.exists()) return super.loadClass(name);
try {
@@ -32,12 +36,24 @@ public Class> loadClass(String name) throws ClassNotFoundException {
}
public static void main(String[] args) throws Exception {
+ String name = "com.mashibing.jvm.Hello";
MyLoader m = new MyLoader();
- Class clazz = m.loadClass("com.mashibing.jvm.Hello");
+ Class clazz = m.loadClass(name);
m = new MyLoader();
- Class clazzNew = m.loadClass("com.mashibing.jvm.Hello");
+ Class clazzNew = m.loadClass(name);
System.out.println(clazz == clazzNew);
}
+
+ private static String getCurrentClassPath() {
+ URL url = T012_ClassReloading2.class.getClassLoader().getResource("");
+ File f = null;
+ try {
+ f = new File(url.toURI());
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ }
+ return f.getPath();
+ }
}
diff --git a/src/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject.java b/src/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject.java
index 8a851c0..6be827a 100644
--- a/src/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject.java
+++ b/src/com/mashibing/jvm/c3_jmm/T03_SizeOfAnObject.java
@@ -1,12 +1,12 @@
package com.mashibing.jvm.c3_jmm;
-import com.mashibing.jvm.agent.ObjectSizeAgent;
+//import com.mashibing.jvm.agent.ObjectSizeAgent;
public class T03_SizeOfAnObject {
public static void main(String[] args) {
- System.out.println(ObjectSizeAgent.sizeOf(new Object()));
- System.out.println(ObjectSizeAgent.sizeOf(new int[] {}));
- System.out.println(ObjectSizeAgent.sizeOf(new P()));
+// System.out.println(ObjectSizeAgent.sizeOf(new Object()));
+// System.out.println(ObjectSizeAgent.sizeOf(new int[] {}));
+// System.out.println(ObjectSizeAgent.sizeOf(new P()));
}
//一个Object占多少个字节