java 8 migration하면서 좋은 팁을 소개한다. 


java 7에서 java8로 migration할 때는 Oralce의 java se 8 compatibility guide 링크를 참고한다. 

http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html



The class file version for Java SE 8 is 52.0 as per the JVM Specification. Version 52.0 class files produced by a Java SE 8 compiler cannot be used in earlier releases of Java SE.


삭제된 것은 install과 deploy 관련된 부분들이 존재한다. 

http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html#A999476


deprecated된 것들

http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html#A1000033



GC 관련해서 바뀐 부분이 존재한다.

class 를 저장하던 metadata 영역이 head에서 native memory로 넘어간다. 



Area: HotSpot / gc 

Synopsis

The command line flags PermSize and MaxPermSize have been removed and are ignored. If used on the command line a warning will be emitted for each.

Java HotSpot(TM) Server VM warning: ignoring option PermSize=32m; support 
was removed in 8.0
Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=128m; support 
was removed in 8.0
Nature of Incompatibility

source




Area: HotSpot / gc 

Deprecated Feature

The following garbage collector combinations are deprecated:

  • DefNew + CMS

  • ParNew + SerialOld

  • Incremental CMS

Corresponding command-line options produce warning messages and it is recommended to avoid using them. These options will be removed in one of the next major releases.

  • The -Xincgc option is deprecated

  • The -XX:CMSIncrementalMode option is deprecated. Note that this also affects allCMSIncremental options.

  • The -XX:+UseParNewGC option is deprecated, unless you also specify -XX:+UseConcMarkSweepGC.

  • The -XX:-UseParNewGC option is deprecated only in combination with -XX:+UseConcMarkSweepGC.





*  permsize 

MaxPermSize 매개변수와 permSize 매개변수는 더 이상 java8에서 사용하지 않는다. 

이 영역은 java7 이전에는 permanent 영역에 있었지만, java8 부터는 metaspace영역(native heap)으로 이동하게 되었다. 


이 영역에 대한 제어를 하려면, –XX:MaxMetaspaceSize (기본 값은 21MB)를 사용해야 할 필요가 있다. 관련된 매개변수로  ‑XX:MinMetaspaceFreeRatio와 ‑XX:MaxMetaspaceFreeRatio 가 존재한다..


https://www.infoq.com/articles/Java-PERMGEN-Removed

Posted by '김용환'
,