6ãæãçµéããŸãããã€ãŸãã æ°ããJavaãã€ã³ã¹ããŒã«ãããšãã§ãã é·ãæ ã§ããããæåŸã«å°éãã人ã¯ã»ãšãã©ããŸããã§ããã æªå å·¥ã®è¡ã¯èå³æ·±ãJEPããå€ããŸããããæ®ãã®éšåã«ã€ããŠã¯èª¬æããŸãã
ãã¹ãŠã¯ã©ãã§ãã
Javaã®æ°ããããŒãžã§ã³ã®ãªãªãŒã¹ã¯ãçŽ6ãæã®é·ãã®æ°ãããå éãããããªãªãŒã¹ãµã€ã¯ã«ã«åŸã£ãŠè¡ãããŸãã æ£ç¢ºãªæ¥ä»ã¯ãããžã§ã¯ãããŒãžã§å®çŸ©ãããŠããŸã ã JDK 12ã«ã¯ããã€ãã®äž»èŠãªãã§ãŒãºããããŸããã
- 2018/12/13-æžéã®æåã®ãã§ãŒãºïŒãã®æç¹ã§ããªããžããªã®ã¡ã€ã³ãã©ã³ãããåå²ãäœæãããŸãïŒã
- 2019/01/17-æžéã®ç¬¬2ãã§ãŒãºïŒå¯èœãªãã¹ãŠãå®äºïŒ;
- 2019/02/07-ãªãªãŒã¹åè£ïŒæãéèŠãªãã°ã®ã¿ãä¿®æ£ãããŠããŸãïŒ;
- 2019/03/19-ãªãªãŒã¹ãäžè¬æäŸéå§ã <-ããªãã¯ããã«ããŸã
ãã®ã¹ã±ãžã¥ãŒã«ããäœãåŸãããŸããïŒ ã¯ããå®éã®ãšãããäœããããŸããããã£ããã·ã¥ã©ã€ã³ã«ãã©ãçããã°ããã§ãæ°ããæ°é®®ãªJDK 12ã®é ç¹ããã¬ã¬ã·ãŒã®æ奜家ãèŠå®ã£ãŠããŸãã
ãã°ïŒ ãããã¯ïŒ äžçªäžãŸã§ïŒ
æ°ããéLTSããŒãžã§ã³ããªãªãŒã¹ããããšããé垞誰ããæ°æ©èœã«ã€ããŠæ°ã«ããŸããã ãã¹ãŠãå°çã«åŽ©ãããªããã£ãšé¢çœãã§ãã
ãã¡ãããå€ãã®ãã°ããããŸãããJDK 12ã«ã¯ãããŸãã:) jirããå€æãããšããã¹ãŠãæ£åžžã§ãã
ããã«ã ããšã¯äœããæ£ç¢ºã«ç解ã§ããããã«ããªã¯ãšã¹ããåŒçšããŸãã
project = JDK AND issuetype = Bug AND status in (Open, "In Progress", New) AND priority in (P1) AND (fixVersion in (12) OR fixVersion is EMPTY AND affectedVersion in (12) AND affectedVersion not in regexVersion("11.*", "10.*", "9.*", "8.*", "7.*", "6.*")) AND (labels is EMPTY OR labels not in (jdk12-defer-request, noreg-demo, noreg-doc, noreg-self)) AND (component not in (docs, globalization, infrastructure) OR component = infrastructure AND subcomponent = build) AND reporter != "Shadow Bug" ORDER BY priority, component, subcomponent, assignee
ãã¡ããã äžè¬çãªãã°ã«ã¯ããã¹ãå ŽæããããŸããããã®ãããªå·šå€§ãªãããžã§ã¯ãã§ã¯ã©ãã«ãè¡ããŸããã çŸæç¹ã§ã¯P1ã®ãã°ã«æ°ä»ããŠããªããšããã ãã§ãã
ãã°ãšã®ããæ£åŒãªã³ãã¥ãã±ãŒã·ã§ã³ã¯ãç¹å¥ãªããã¥ã¡ã³ãJEP 3ïŒJDK Release Processã§å®£èšãããŠããŸããããã¯ãJava Oceanã®ä¹±æµã«é¢ããäžæ» ã®ã¹ãã¥ã¯ãŒãã§ããMark ReinholdãææããŠããŸãã
ç¹ã«ã次ã®ããšãäŒãã段èœãæãäžãã䟡å€ããããŸãã 誰ã責任ãè² ããäœããã¹ãã 12åç®ã®ãªãªãŒã¹ã®æéããªãå Žåã®ãã±ããã®è»¢éæ¹æ³ã Nãã©ã®ãªãªãŒã¹ãã転éããããã瀺ãã©ãã«jdk$N-defer-request
ããã°ãã©ãã«ãŒã«å
¥ããã³ã¡ã³ããæ®ãå¿
èŠããããŸããæåã®è¡ã¯Deferral Requestã§ãã ããã«ããã®ãããªãã¹ãŠã®èŠæ±ã®ã¬ãã¥ãŒã¯ãããããã®åéããã³ãããžã§ã¯ãã®ãªãŒãã«ãã£ãŠè¡ãããŸãã
TCKãæž¡ãåé¡ã¯ãã®æ¹æ³ã§ã¯ç¡èŠã§ããŸãããJavaãJavaã®ãŸãŸã§ãããã«ãšã«ã®ãããªãã®ã§ã¯ãªãããšãä¿èšŒãããŸãã jdk$N-defer-request label
ãæ¶ããããšã¯ãããŸããã ã¿ã°ãåé€ããªããšããã«ãŒã«ã«éåããŠãã人ã
ã«å¯ŸããŠåœŒããäœããããã¯èå³æ·±ãã§ããã¢ã«ã¢ããã«é€ãäžããããšããå§ãããŸãã
ãã ãããã®æ¹æ³ã§ã¯ãJDK 13ã«ç§»æ€ããããã°ã®æ°ã確èªã§ããŸãããã®ã¯ãšãªãè©ŠããŠã¿ãŸãããã
project = JDK AND issuetype = Bug AND status in (Open, "In Progress", New) AND (labels in (jdk12-defer-request) AND labels not in (noreg-demo, noreg-doc, noreg-self)) AND (component not in (docs, globalization, infrastructure) OR component = infrastructure AND subcomponent = build) AND reporter != "Shadow Bug" ORDER BY priority, component, subcomponent, assignee
JDK-8216039ã® 1ããŒã¹ã®ã¿ïŒãBCããã³RSASSA-PSSã䜿çšããTLSã¯ECDHServerKeyExchangeãäžæããŸããã åããªã ããã§ããã®è°è«ã圹ã«ç«ããªãå Žåã¯ãåŒè·å£«ãšããŠé®éå€ãè©Šãããšããå§ãããŸãã
ãããŠãäžçªäžã®è¡ã¯äœã§ããïŒ
ã»ãšãã©ã®æ©èœããŠãŒã¶ãŒïŒJavaããã°ã©ããŒïŒã§ã¯ãªããOpenJDKèªäœã®éçºè ã«åœ±é¿ããããšã¯æããã§ãã ãããã£ãŠã念ã®ãããæ©èœãexternalãšinternalã«åããŸãã ããªãã¯å éšã®ãã®ãã¹ãããããããšãã§ããŸãããç§ã¯è ¹ãç«ãŠãŠããŸããç§ã¯ããããã®ããã¹ããæžããŸããã
189ïŒ ã·ã§ãã³ããŒïŒäžæåæ¢æéã®çãã¬ããŒãžã³ã¬ã¯ã¿ãŒïŒå®éšçïŒ
å€éšæ©èœ ã èŠããã«ãç¹ã«SLAã10ã500ããªç§ã®ãªãŒããŒã®å¿çæ§ãå¿ èŠãšããå ŽåãJavaã®é床ãäœäžãããšã人ã ã¯ããã奜ãŸãªããªããŸãã ããã§ããã®ç¯å²ã®å·Šç«¯ã«è¿ã¥ãããã«åäœããç¡æã®äœãã³ãGCãã§ããŸããã ãã¬ãŒããªãã¯ãCPUãšRAMã亀æããŠåŸ ã¡æéãççž®ããããšã§ãã ãããã¿ã°ä»ããšå§çž®ãã§ãŒãºã¯ãã©ã€ãã¢ããªã±ãŒã·ã§ã³ã¹ã¬ãããšäžŠè¡ããŠåäœããŸãã æ®ãã®å°ããªäžæåæ¢ã¯ããªããžã§ã¯ãã®ã°ã©ãã®ã«ãŒããæ€çŽ¢ããã³æŽæ°ããå¿ èŠãããããã§ãã
äžèšã®ããããæå³ããªããªãå Žåãããã¯åé¡ã§ã¯ãããŸãããã·ã§ãã³ãã¢ã¯ãåºç€ãšãªãããã»ã¹ãç解ããŠãããã©ããã«é¢ä¿ãªãåäœããŸãã
Alexei ShipilevãKristina FloodãRoman Kennkeãåãçµãã§ããŸãããããã®äººã ã«ã€ããŠç¥ããªãããã«äžçæžåœåªåããå¿ èŠããããŸãã GCã®ä»çµã¿ãäžè¬çã«ç解ããŠããã®ã«éçºè ãäœãã§ãããæ³åããŠããªãå Žåã¯ãçŽ æŽãããLeshinaã®èšäºãOpenJDKåãã®èªå®¶è£œã¬ããŒãžã³ã¬ã¯ã¿ãŒããŸãã¯JVM Anatomy Quarksã·ãªãŒãºã®ãã°ããã翻蚳ãã芧ã«ãªãããšããå§ãããŸãã ããã¯ãšãŠããããããã§ãã
éåžžã«éèŠã§ãã Oracleã¯ãShandoahã®ãªãªãŒã¹ãã«ããjdk.java.netã®ãã®ãoracle.comã®ãã®ãå«ããŠåºè·ããªãããšã«ããŸããã Shenandoahã¯JDK 12ã®æãéèŠãªæ©èœã®1ã€ã§ãããããããšãã°Azulããã®å ¬åŒã¢ã»ã³ããªãã€ã³ã¹ããŒã«ãã䟡å€ããããŸãã
230ïŒ Microbenchmark Suite
å éšæ©èœ ã ãã€ã¯ããã³ãããŒã¯ãäœæããããšããããšããããªããããã¯JMHã§è¡ãããŠããããšãããããŸãã JMHã¯ãJavaããã³ä»ã®JVMèšèªã®ãã€ã¯ããã³ãããŒã¯ãäœæãã¢ã»ã³ãã«ãå®è¡ãããã³åæããããã®ãã¬ãŒã ã¯ãŒã¯ã§ããã 誰ããããæžããããç解ããŠããŸãïŒãã¹ãŠã®äžèŽã¯ã©ã³ãã ã§ãïŒã æ®å¿µãªããããéåžžã®ãã¢ããªã±ãŒã·ã§ã³ã®äžçã§è¡ãããŠãããã¹ãŠãJDKå ã«é©çšã§ããããã§ã¯ãããŸããã ããšãã°ãéåžžã®Spring Frameworkã³ãŒããããã«è¡šç€ºãããããšã¯ã»ãšãã©ãããŸããã
幞ããªããšã«ãããŒãžã§ã³12以éãå°ãªããšãJMHã䜿çšã§ããŸãããŸããJMHã«ã¯äžé£ã®ãã¹ãããã§ã«èšè¿°ãããŠããŸãã jdk/jdk/test/micro/org/openjdk/bench
確èªã§ããŸãïŒãã©ãŠã¶ã§çŽæ¥ç¢ºèªã§ããŸãããã®ãã¹ã¯ãªã³ã¯ã§ãïŒã
ããšãã°ãGCãã¹ãã¯æ¬¡ã®ããã«ãªããŸãã
ããã«StackOverflowããªãããšãæãåºããŠãã ããã 察å¿ãããã¡ã€ã«ãšOpenJDKãããžã§ã¯ãã®ãã¹ãŠã®ã©ã€ã»ã³ã¹ãèªãã§èŠ³å¯ããããšãªããã³ããŒã¢ã³ãããŒã¹ãã®ã³ãŒãããããšä»¥éã§äœ¿çšããããšã¯çŠããããŠããŸããããããªããšãæåŸã®éŽäžãç°¡åã«å ¥æã§ããŸãã
@BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @State(Scope.Thread) public class Alloc { public static final int LENGTH = 400; public static final int ARR_LEN = 100; public int largeLen = 100; public int smalllen = 6; @Benchmark public void testLargeConstArray(Blackhole bh) throws Exception { int localArrlen = ARR_LEN; for (int i = 0; i < LENGTH; i++) { Object[] tmp = new Object[localArrlen]; bh.consume(tmp); } } //... }
325ïŒåŒã®åãæ¿ãïŒãã¬ãã¥ãŒïŒ
å€éšæ©èœ ã ããã¯ã3ç»é¢ä»¥äžã®é·ãã®ãšã³ãã¬ã¹ã¹ã€ãããäœæããã¢ãããŒããæ ¹æ¬çã«å€æŽããŸãã èŠãŠïŒ
Virgin Java Switch vs ...
int dayNum = -1; switch (day) { case MONDAY: case FRIDAY: case SUNDAY: dayNum = 6; break; case TUESDAY: dayNum = 7; break; case THURSDAY: case SATURDAY: dayNum = 8; break; case WEDNESDAY: dayNum = 9; break; }
æªãçç± ïŒæåãããããããã®ã§ãäŒæ©ãã¹ãããã§ããŸãïŒç¹ã«ãããªããäžæ¯è ã§ããããADHDã«ããã£ãŠããå ŽåïŒã
... vs Chad Java Swtich ExpressionïŒ
int dayNum = switch (day) { case MONDAY -> 0; case TUESDAY -> 1; default -> { int k = day.toString().length(); int result = f(k); break result; } };
ãªãè¯ãã®ã ïŒæ°æåãå®å šã䟿å©ãæ°ããã¯ãŒã«ãªæ©èœ
ããŒãã¹ ïŒããªãããµãã£ã¹ããªããäœåãã®IDEéçºè
ããã®æ©èœã®ãµããŒãã«èŠããã§ããã®ã§ãããã¯ããªãã«æãæ·±ãæºè¶³ãäžããŸãã ã¯ããã¯ããã¯ãïŒ 4æ6æ¥ã®ã¬ããŒãã®åŸã«åœŒãæãŸãããã¹ãŠã®æ±ãã詳现ãäžå¯§ã«äŒããããã«é Œãããšãã§ããŸãã
ããã¯ãã¬ãã¥ãŒæ©èœã§ãããæ©èœããŸããã ã³ã³ãã€ã«æã«ã¯ãjavac
ã³ãã³ãã©ã€ã³ãªãã·ã§ã³--enable-preview --release 12
ãæž¡ããjava
ãå®è¡ããå¿ èŠããããŸãïŒ--enable-preview
ãã©ã°ã®ã¿ïŒã
334ïŒ JVMå®æ°API
å éšæ©èœ ã éçºè ã¯ã¯ã©ã¹ãã¡ã€ã«ãæäœããå¿ èŠããããŸãã ããã䟿å©ã«è¡ãå¿ èŠãããããããåé¡ã®ã¹ããŒãã¡ã³ãã§ãã å°ãªããšãããã®JEPãææããŠãããã©ã€ã¢ã³ã²ããã¯ããèšã£ãŠããŸã:-)ãããã¯ãã¹ãŠããã倧ããªæŠå Žã®äžéšã§ãããä»ã®ãšããã¯æ·±ãå ¥ããŸããã
åJavaã¯ã©ã¹ã«ã¯ããããããå®æ°ããŒã«ãããããããã€ãã®å€ïŒæååãæŽæ°ãªã©ïŒããŸãã¯ã¯ã©ã¹ãã¡ãœãããªã©ã®ã©ã³ã¿ã€ã ãšã³ãã£ãã£ã®ãã³ãããããŸãã ldc- "load costant"åœä»€ã䜿çšããŠãã®ãã³ããæãäžããããšãã§ããããããã®ãã¹ãŠã®ãžã£ã³ã¯ã¯ããŒãå¯èœå®æ°ãšåŒã°ããŸãã invokedynamicã«ã¯ãŸã ç¹å¥ãªã±ãŒã¹ããããŸãããæ°ã«ããå¿ èŠã¯ãããŸããã
ã¯ã©ã¹ãã¡ã€ã«ã§äœæ¥ããå Žåããã€ãã³ãŒãèšåšãã·ãã¥ã¬ãŒãããã®ã䟿å©ã§ãããããã£ãŠãããŒãå¯èœãªå®æ°ã§ãã æåã®æ¬²æ±ã¯ã察å¿ããJavaåãåçŽã«äœæããããšã§ããããããã«ãçããŠãããã¯ã©ã¹ã§ããCONSTANT_Class_info
æ§é äœã衚瀺ããã«ã¯ã©ãããã°ããã§ããïŒ Class
ãªããžã§ã¯ãã¯ãã¯ã©ã¹ããŒãã£ã³ã°ã®æ£ç¢ºããšäžè²«æ§ã«äŸåããJavaã§ã®ã¯ã©ã¹ã®ããŒãã£ã³ã°ã«ãããå°çã®ãããªããã£ããªã¢ãäœæãããŸãã ããããããã¹ãŠã®ã¯ã©ã¹ãVMã«ããŒãã§ããããã§ã¯ãããŸããããããããèšè¿°ããå¿
èŠããããŸãïŒ
ã¯ã©ã¹ãã¡ãœãããã¡ãœãããã³ãã«ãåçå®æ°ãªã©ã®ããŸãç¥ãããŠããªãç£ãªã©ããããã®åŸ®åŠãªç¹ããã¹ãŠèæ ®ããŠãäœããã®åœ¢ã§ç®¡çããããšæããŸãã
ããã¯ã å€ã«åºã¥ããæ°ããã¿ã€ãã®ã·ã³ããªãã¯ãªã³ã¯ïŒ JVMS 5.1ã®æå³ïŒãå°å
¥ããããšã§è§£æ±ºãããŸããåã·ã³ããªãã¯ãªã³ã¯ã¯ãç¹å®ã®ã¿ã€ãã®å®æ°ãèšè¿°ããŠããŸãã ã¯ã©ã¹ã®ããŒããã¢ã¯ã»ã¹ã®åé¡ããåé¢ããŠãçŽç²ã«åç®äžèª¬æããŸãã 圌ãã¯java.lang.invoke.constant
ãããªããã±ãŒãžã«äœãã§ããŠããããèŠæ±ããŸãããã ããã§ããããèŠãããšãã§ããŸã ã
340ïŒ 2ã€ã§ã¯ãªã1ã€ã®AArch64ããŒã
å€éšæ©èœ ã ãã§ã«JDK 9ã§ã¯ãOracleãšRed Hatãåæã«ARMããŒããã¢ã©ãŒãç¶æ
ã«ãããšããå¥åŠãªç¶æ³ããããŸããã ãããŠãç©èªã®çµãããèŠããŸãããªã©ã¯ãã枯ã®64ãããéšåãäžæµããåé€ãããŸããã
é·ãæŽå²ãæãäžããããšã¯å¯èœã§ããããã£ãšè¯ãæ¹æ³ããããŸãã BellSoftã¯ãã®JEPã®éçºã«åå ãããã®ãªãã£ã¹ã¯ãµã³ã¯ãããã«ãã«ã¯ã®ãªã©ã¯ã«ã®æ§ãªãã£ã¹ã®é£ã«ãããŸãã
ãããã£ãŠãããã«BellSoftã®CTOã§ããAlexey Voitilovã«ç®ãåããŸããã
ãBellSoftã¯ãx86 Linux / Windows / Macããã³Solaris / SPARCã«å ããŠãARMããµããŒãããLiberica JDKãèµ·åããŸããARMçšJDK 9ããããµãŒããŒã¢ããªã±ãŒã·ã§ã³ã®AARCH64ããŒãã®ããã©ãŒãã³ã¹ã®æ¹åã«çŠç¹ãåœãŠãARMããŒãã®32ãããéšåã®ãµããŒããç¶ç¶ããŸãããã®ãããJDK 11ã®ãªãªãŒã¹æã«ã¯ãOracleïŒOracleãå«ãïŒã®64ãããããŒãéšåã誰ããµããŒãããŠããªãç¶æ³ããããOpenJDKã³ãã¥ããã£ã¯AARCH64ããŒãã«éäžããããã«64ãããããŒãéšåãåé€ããããšã決ããŸãããåç §ãäŸãã°ã JEP 315 ãããã¯æã JDK 12ã«çµ±åãããŠãããJDK 12以éãOracleã®ããŒãã«ãããã¹ãŠã®æ©èœããµããŒãããŠããŸãïŒæåŸã®æ©èœã9æã«çµ±åããMinimal VMïŒããããã£ãŠãJDK 12ã§ãã®åºæ¬ãåé€ã§ããããã«ãªããŸãããã³ãã¥ããã£ã¯AARCH64ã®1ã€ã®ããŒããš1ã€ã®ARM32ã®ããŒããåãåããŸããããã¡ããããµããŒãã容æã«ãªããŸãã
341ïŒ ããã©ã«ãã®CDSã¢ãŒã«ã€ã
å éšæ©èœ ã åé¡ã¯ãJavaã¢ããªã±ãŒã·ã§ã³ã®èµ·åæã«ãæ°åã®ã¯ã©ã¹ãããŒãããããããèµ·åæã«Javaãå€§å¹ ã«é ããªããšããæèŠãçã¿åºããŸãã ããããåãã€ãã®ã¯èª°ã§ãããããã¯åãªããæèŠãã§ã¯ãããŸãã-ããã§ãã å€ä»£ããåé¡ã解決ããããã«ãããŸããŸãªååŒãå®è·µãããŠããŸãã
ã¯ã©ã¹ããŒã¿ã®å ±æã¯ãJDK 8 Update 40ã®åçšæ©èœã®ããã«ã 倪å€ããç§ãã¡ã«ãã£ãŠããæ©èœã§ãããã®ã¹ã¿ãŒãã¢ããã¬ããŒãžããã¹ãŠãç¬èªã®åœ¢åŒã®ã¢ãŒã«ã€ãã«ããã¯ããããšãã§ããŸãïŒã©ã®åœ¢åŒããç¥ãå¿ èŠã¯ãããŸããïŒãã¢ããªã±ãŒã·ã§ã³ãå¢ããŠããŸãã ãããŠãã°ããããŠã JEP 310ãç»å ŽããŸãããã¢ããªã±ãŒã·ã§ã³ã¯ã©ã¹ãšããŒã¿ã®å ±æãããã«ãããã·ã¹ãã ã¯ã©ã¹ã ãã§ãªããã¢ããªã±ãŒã·ã§ã³ã¯ã©ã¹ãåãããã«æ±ãããšãã§ããŸããã
JDKã¯ã©ã¹ã®å Žåã次ã®ããã«ãªããŸãã ãŸãã java -Xshare:dump
ã³ãã³ãã§ã¯ã©ã¹ããã³ãããŠãããã¢ããªã±ãŒã·ã§ã³ãå®è¡ããŠããã®ãã£ãã·ã¥ã䜿çšããããã«æ瀺ããŸãïŒ java -Xshare:on -jar app.jar
ã ãã¹ãŠãã¹ã¿ãŒãã¢ããã¯å°ãæ¹åãããŸããã ãã®æ©èœã«ã€ããŠç¥ã£ãŠããŸãããïŒ ãŸã ç¥ããªãå€ãã®äººïŒ
ããã§ã¯å¥åŠã«èŠããŸãïŒãªãæ¯å-Xshare:dump
JDKãã£ã¹ããªãã¥ãŒã·ã§ã³ãäœæãã段éã§ããã®ã³ãã³ãã®ããã©ã«ãçµæããããã«äºæž¬å¯èœãªå Žåã -Xshare:dump
ããã®ã¯ãªãã§ããïŒ ææžã«ãããšãã€ã³ã¹ããŒã©ãŒã䜿çšããŠJava 8ãã£ã¹ããªãã¥ãŒã·ã§ã³ãã€ã³ã¹ããŒã«ãããå Žåãã€ã³ã¹ããŒã«æã«å¿
èŠãªã³ãã³ããå®è¡ããå¿
èŠããããŸãã åæ§ã«ãã€ã³ã¹ããŒã©ãŒã¯é
ã
ã§éãã«æ¡æããŠããŸãã ãããããªãã§ããïŒ ãããŠãã€ã³ã¹ããŒã©ãŒãšããŠã§ã¯ãªããzipãã¡ã€ã«ãšããŠé
åžãããé
åžãã©ããããïŒ
ç°¡åã§ããJDK12以éãCDSã¢ãŒã«ã€ãã¯ããªã³ã¯ã®çŽåŸã«é åžãããã®äœæè ã«ãã£ãŠçæãããŸãã ãã€ããã«ãã®å Žåã§ãïŒã¯ãã¹ã³ã³ãã€ã«çšã§ã¯ãªãã64ãããã§ãã€ãã£ãã§ããå ŽåïŒã
JDK 11以éãããã©ã«ãã§-Xshare:auto
æå¹ã«ãªãããã®ãããªã¢ãŒã«ã€ããèªåçã«-Xshare:auto
ããããŠãŒã¶ãŒã¯ãã®æ©èœã®ååšã«ã€ããŠç¥ãå¿
èŠãããããŸããã ãããã£ãŠã JDK 12ã«æŽæ°ããã ãã§ãã¢ããªã±ãŒã·ã§ã³ã®èµ·åãé«éåãããŸãã
344ïŒ G1ã®äžæ¢å¯èœãªæ··åã³ã¬ã¯ã·ã§ã³
å
éšæ©èœ ã æ£çŽã«èšããš ç§ã¯G1ã®ä»äºã§äœãç解ããŠããŸãã GCã®æ©èœã®èª¬æã¯ããããããä»äºã§ãã 説æè
ãšç解ã®äž¡æ¹ãã圌ã®äœåã®è©³çŽ°ãç解ããå¿
èŠããããŸãã ã»ãšãã©ã®äººã«ãšã£ãŠãGCã¯ãäœããã®å Žåã«ããŸããããšãã§ããå
ãã¿ãã³ã®äžçš®ã®å°çã§ãã ãããã£ãŠãåé¡ã¯äœãšãç°¡åã«èª¬æããå¿
èŠããããŸãã
åé¡ ïŒG1ã®æ¹ãããŸããããããããŸããã
åé¡ã¯ãGCãå€ãã®ãã©ã¡ãŒã¿ãŒã®åŠ¥åç¹ã§ããããã®1ã€ãäžæåæ¢ã®é·ãã§ãããšããããšã§ãã äžæåæ¢ãé·ãããå Žåããããããããã£ã³ã»ã«ã§ãããšäŸ¿å©ã§ãã
ããã¯ãã€èµ·ãããŸããïŒ G1ã¯ã¢ããªã±ãŒã·ã§ã³ã®åäœãå®éã«åæãããã®çµè«ã«åºã¥ããŠäœæ¥ã®æåç·ïŒ ã³ã¬ã¯ã·ã§ã³ã»ãããšããŠè¡šãããïŒãéžæããŸãã äœæ¥ç¯å²ãæ¿èªããããšãG1ã¯ã³ã¬ã¯ã·ã§ã³ã»ããå ã®ãã¹ãŠã®çããŠãããªããžã§ã¯ãããé åºãã€ãã³ã¹ãããã§äžåºŠã«åéããããšãçŽæããŸãã æéãããããããå ŽåããããŸãã æ¬è³ªçã«ãããã¯G1ãäœæ¥éã誀ã£ãŠèšç®ããããšãæå³ããŸãã ã¢ããªã±ãŒã·ã§ã³ã®æ¯ãèããçªç¶å€æŽããããšã§ã圌ãã ãŸãããå¯èœæ§ããããŸããããã«ãããã³ã¬ã¯ã·ã§ã³ã»ããã«å€ãã®å€ãé åãå ¥ã£ããšãã«ããã¥ãŒãªã¹ãã£ãã¯ãäžè¯ããŒã¿ã®äžã§åäœããããã«ãªããŸãã
ç¶æ³ããæãåºãããã«ãG1ã¯æ¬¡ã®ã¡ã«ããºã ã«ãã£ãŠãã¡ã€ãã©ã€ãºãããŸããïŒãã¥ãŒãªã¹ãã£ãã¯ãå®æçã«èª€ã£ãäœæ¥éãéžæããå ŽåãG1ã¯ã€ã³ã¯ãªã¡ã³ã¿ã«ã¬ããŒãžã³ã¬ã¯ã·ã§ã³ã«ã¹ããããã€ã¹ãããã§åãæ¿ãã次ã®åã¹ãããïŒã¿ãŒã²ããå®è¡æéã«åãŸããªãå ŽåïŒããã£ã³ã»ã«ã§ããŸãã äœããå°ããã€åéããã®ã¯çã«ããªã£ãŠããªãïŒè¥ãå°åïŒã®ã§ããã®ãããªäœæ¥ã¯ãã¹ãŠãå¿ é ããããã¯ã§åŒ·èª¿è¡šç€ºãããåŒãç¶ãç¶ç¶çã«å®è¡ãããŸãã
ãšã³ããŠãŒã¶ãŒãã©ãããŸããïŒ äœããJDK 12ã«ã¢ããã°ã¬ãŒãããå¿ èŠã¯ãããŸãããããèªäœããã¹ãŠè¯ããªããŸãã
346ïŒ G1ããæªäœ¿çšã®ã³ãããæžã¿ã¡ã¢ãªãéããã«è¿ã
å éšæ©èœ ã åé¡ã¯ã誰ãç©æ¥µçã«äœ¿çšããŠããªã倧ããªããããããå Žåããã®éã¢ã¯ãã£ããªã¡ã¢ãªããã¹ãŠãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«æ»ãããšã¯å ¬å¹³ã«æããŸãã ãã ããJDK 12ããåã§ã¯ãããã¯çºçããŸããã§ããã
äžæåæ¢ã®é·ãã«é¢ããç®æšãéæããããã«ãG1ã¯ã€ã³ã¯ãªã¡ã³ã¿ã«ããã©ã¬ã«ãããã³ãã«ãã¹ããŒãžãµã€ã¯ã«ã®ã»ãããå®è¡ããŸãã JDK 11ã§ã¯ãã³ããããããã¡ã¢ãªããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«ãã«GCã§ã®ã¿ããŸãã¯äžŠåããŒãã³ã°ãã§ãŒãºäžã«æäŸããŸãã ãã®ã³ã°ãæ¥ç¶ãããšïŒ-XloggcïŒ/home/gc.log -XXïŒ+ PrintGCDetails -XXïŒ+ PrintGCDateStampsïŒããã®ãã§ãŒãºã¯æ¬¡ã®ããã«è¡šç€ºãããŸãã
8801.974: [G1Ergonomics (Concurrent Cycles) request concurrent cycle initiation, reason: occupancy higher than threshold, occupancy: 12582912000 bytes, allocation request: 0 bytes, threshold: 12562779330 bytes (45.00 %), source: end of GC] 8804.670: [G1Ergonomics (Concurrent Cycles) initiate concurrent cycle, reason: concurrent cycle initiation requested] 8805.612: [GC concurrent-mark-start] 8820.483: [GC concurrent-mark-end, 14.8711620 secs]
ãããããããšã«ãG1ã¯ã§ããéãå®å šãªåæ¢ã«èŠåŽãã䞊è¡ãµã€ã¯ã«ã¯é »ç¹ãªå²ãåœãŠãšããŒãã®è©°ãŸãã§ã®ã¿éå§ãããŸãã ç§ãã¡ã®ç¶æ³ã¯ã誰ãè °ã«è§ŠããŠããªããšããã¡ããã©å察ã§ãã ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«ã¡ã¢ãªãæäŸããããã«G1ãã¹ã¯ã©ããããç¶æ³ã¯éåžžã«ãŸãã§ãïŒ
ãããã£ãŠã誰ãããã®åé¡ïŒãæªå ã®ãããªRAMãããã«è³Œå ¥ãããïŒã§åŸç¹ããã§ããããããããããã§ãªãå Žå-ããããçš®é¡ã®ã¯ã©ãŠããšã³ã³ãããŒããããããã¯äžååãªå©çšãšæ·±å»ãªãéã®æ倱ãæå³ããŸãã èŠãŠã ãªããŠã¯ãŒã«ãªã¬ããŒã ãçã¿ã§ãã£ã±ãã«ãªã£ãã
解決çã¯ããã®ç¹å®ã®ã±ãŒã¹ã§G1ãé©åã«åäœããããã«æããããšã§ãããOpenJ9ã®ShenandaãŸãã¯GenConããã§ã«ç¥ã£ãŠãããšããã§ãã è¡é¢ç¯ã®äžååãªäœ¿çšãå€æããããã«å¿ããŠãã®äœ¿çšãæžããå¿ èŠããããŸãã Tomcatã®äžéšã®ãã¹ãã§ã¯ãããã«ããã¡ã¢ãªæ¶è²»éãã»ãŒååã«æžããããšãã§ããŸããã
äžçªäžã®è¡ã¯ãã¢ããªã±ãŒã·ã§ã³ãéã¢ã¯ãã£ãã§ãããšèŠãªãããããšããŸãã¯æåŸã®ãã«ãããééïŒããªç§åäœïŒãgetloadavg()
ããåæãµã€ã¯ã«ããªãå ŽåããŸãã¯1åégetloadavg()
ãç¹å®ã®ãããå€ãäžåãè² è·ã瀺ããå Žåã§ãã ããã®1ã€ãçºçãããšããã«ãå®æçãªã¬ããŒãžã³ã¬ã¯ã·ã§ã³ãéå§ãããŸããå®å
šãªã¢ã»ã³ããªãšåãããã«ã¯ãªãŒã³ã«ãªãããšã¯ãããŸããããã¢ããªã±ãŒã·ã§ã³ãžã®åœ±é¿ã¯æå°éã«ãªããŸãã
ãã®ãã°ã«ããã·ã¥ã§ããŸãïŒ
(1) [6.084s][debug][gc,periodic ] Checking for periodic GC. [6.086s][info ][gc ] GC(13) Pause Young (Concurrent Start) (G1 Periodic Collection) 37M->36M(78M) 1.786ms (2) [9.087s][debug][gc,periodic ] Checking for periodic GC. [9.088s][info ][gc ] GC(15) Pause Young (Prepare Mixed) (G1 Periodic Collection) 9M->9M(32M) 0.722ms (3) [12.089s][debug][gc,periodic ] Checking for periodic GC. [12.091s][info ][gc ] GC(16) Pause Young (Mixed) (G1 Periodic Collection) 9M->5M(32M) 1.776ms (4) [15.092s][debug][gc,periodic ] Checking for periodic GC. [15.097s][info ][gc ] GC(17) Pause Young (Mixed) (G1 Periodic Collection) 5M->1M(32M) 4.142ms (5) [18.098s][debug][gc,periodic ] Checking for periodic GC. [18.100s][info ][gc ] GC(18) Pause Young (Concurrent Start) (G1 Periodic Collection) 1M->1M(32M) 1.685ms (6) [21.101s][debug][gc,periodic ] Checking for periodic GC. [21.102s][info ][gc ] GC(20) Pause Young (Concurrent Start) (G1 Periodic Collection) 1M->1M(32M) 0.868ms (7) [24.104s][debug][gc,periodic ] Checking for periodic GC. [24.104s][info ][gc ] GC(22) Pause Young (Concurrent Start) (G1 Periodic Collection) 1M->1M(32M) 0.778ms
ããã£ãïŒ ããŸããã JEPã«ã¯ããã°ã®åè¡ã®è©³çŽ°ãªæ話翻蚳ãã¢ã«ãŽãªãºã ã®ä»çµã¿ãããã³ãã®ä»ãã¹ãŠããããŸãã
ãããã§ãã©ãããŠç§ãèŠã€ããã®ã§ããïŒã -ãé¡ãããŸãã ããã§ã G1PeriodicGCInterval
ãšG1PeriodicGCSystemLoadThreshold
2ã€ã®ãã³ãã«ãè¿œå ãããŸããã G1PeriodicGCInterval
ã G1PeriodicGCSystemLoadThreshold
ããšãã«ãããããšãã§ããŸãã ãã€ãæªããªãããšã¯ééããããŸãããããã¯ãžã£ã¯ã§ãããã€ããŒïŒ
ãŸãšã
ãã®çµæã匷åãªãªãªãŒã¹ãæã«å ¥ããŸãããé©åœã§ã¯ãªããããã©ãŒãã³ã¹ã®æ¹åã«çŠç¹ãåœãŠãé²åã§ãã æ¹åã®æ£ç¢ºãªååã¯ããã©ãŒãã³ã¹ã«é¢ãããã®ã§ããGCã«ã€ããŠã¯3ã€ã®JEPãCDSã«ã€ããŠã¯1ã€ã§ããããã¯åç¬ã§ãªã³ã«ãªããŸãããJDK 12ãžã®ã¢ããã°ã¬ãŒãã®ã¿ãå¿ èŠã§ããããã«ãJDKéçºè åãã®2ã€ã®æ°ããããŒã«ïŒå®æ°APIããã³JMHãã¹ãïŒãããã³ã³ãã¥ããã£ã¯ãARMäžã®åäžã®64ãããããŒãã«éäžã§ããããã«ãªããŸããã
äžè¬çã«ãä»ããJDK 12ã«ã¢ããã°ã¬ãŒãããŠãã ãããForceãããªããšäžç·ã«ãããããããŸããã ããªãã¯ãããå¿ èŠã«ãªããŸãã
åºåã®åã ãŸããªãã4æ5ã6æ¥ã«JPointã«ã³ãã¡ã¬ã³ã¹ãéå¬ãããJDKãšããããçš®é¡ã®æ°æ©èœã«ã€ããŠå€ãã®ç¥èãæã€äººã ãéãŸããŸãã ããšãã°ãAzulã®Simon RitterããJDK 12ïŒäžæ³šæãªèœãšãç©Žãã«ã€ããŠã®è¬æŒãããŸãã ææ°ãªãªãŒã¹ã«ã€ããŠè°è«ããã®ã«æé©ãªå Žæã§ãïŒ JPointã®è©³çŽ°ã«ã€ããŠã¯ã å ¬åŒWebãµã€ããã芧ãã ãã ã