jvm参数调试demo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* @author devin
* @version 1.0.2
* @date 2021-01-13 20:48
*/
public class Demo2 {
private static final int _512KB = 512 * 1024;
private static final int _1MB = 1024 * 1024;
private static final int _6MB = 6 * 1024 * 1024;
private static final int _7MB = 7 * 1024 * 1024;
private static final int _8MB = 8 * 1024 * 1024;

// -Xms20M -Xmx20M -Xmn10M -XX:+UseSerialGC -XX:+PrintGCDetails -verbose:gc

public static void main(String[] args) throws InterruptedException {

BlockingQueue<Integer> queue = new ArrayBlockingQueue<>(3);
queue.add(2);
queue.add(3);
queue.add(5);
queue.put(3);
System.out.println(queue.take());
}

}
Donate comment here