import java.lang.reflect.Field;
public class HelloWorld {
public static class NestClass1 {
private int var;
public void f() throws Exception {
final NestClass2 nest2 = new NestClass2();
// this is ok
nest2.var = 2;
// this is not ok in java8
final Field f2 = NestClass2.class.getDeclaredField("var");
f2.setInt(nest2, 2);
System.out.println(f2.getInt(nest2));
}
}
public static class NestClass2 {
private int var;
}
public static void main(String []args) throws Exception {
new NestClass1().f();
}
}
java -XX:+UnlockExperimentalVMOptions -XX:+UseZGC sourcefile
class HelloZGC {
public static void main(String[] args) {
System.out.println("Say hello to new low pause GC - ZGC!");
}
}
macOS 테스트
Linux/x64 테스트 (ubuntu 18.04 in docker container)
스크린샷 출처: http://cr.openjdk.java.net/~pliden/slides/ZGC-FOSDEM-2018.pdf
처리량도 나쁘지 않고 pause time은 압도적으로 빠른 것으로 나타남
사용예제
public class HelloWorld
{
public static void main(String[] args)
{
var name = "name";
System.out.println(name);
}
}
### New Version-String Scheme
1. 구조
- <major>.<minor>.<security>
1. 사용
- 기존 Java SE 8u231
- 변경 Java 11.0.5
## 지원 중단 (Depreciations)
- Java EE and CORBA Modules
- Web Start
- Applets
- JavaFX
- JavaEE module
- Pack200 Tools and API
- Concurrent Mark Sweep (CMS) Garbage Collector
## 참고
### 웹문서
- [Main - ZGC - OpenJDK Wiki](https://wiki.openjdk.java.net/display/zgc/Main)
- [JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)](https://openjdk.java.net/jeps/333)
- [The Z Garbage Collector](http://cr.openjdk.java.net/~pliden/slides/ZGC-FOSDEM-2018.pdf)
- [Java의 var - 기계인간 John Grib](https://johngrib.github.io/wiki/java10-var/)
- [JEP 181: Nest-Based Access Control | 폭간의 기술블로그](https://sejoung.github.io/2018/09/2018-09-27-JEP_181/#JEP-181-Nest-Based-Access-Control)
좋은 포스팅 잘봤습니다 :)