We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22676d0 commit e2884f3Copy full SHA for e2884f3
1 file changed
src/main/java/com/crossoverjie/gc/MinorGC.java
@@ -0,0 +1,27 @@
1
+package com.crossoverjie.gc;
2
+
3
+/**
4
+ * Function: Eden区不够分配时,发生minorGC
5
+ *
6
+ * @author crossoverJie
7
+ * Date: 17/01/2018 22:57
8
+ * @since JDK 1.8
9
+ */
10
+public class MinorGC {
11
12
+ /**
13
+ * 1M
14
15
+ private static final int SIZE = 1024 * 1024 ;
16
17
+ public static void main(String[] args) {
18
+ byte[] one ;
19
+ byte[] four ;
20
21
+ one = new byte[2 * SIZE] ;
22
23
24
+ //再分配一个 5M 内存时,Eden区不够了,
25
+ four = new byte[5 * SIZE] ;
26
+ }
27
+}
0 commit comments