2019/11/23 JJUG CCC 2019 Fall - æ¥æ¬Javaã¦ã¼ã¶ã¼ã°ã«ã¼ã ç»å£è³æã§ãã
ä½åº¦ãæãã¦ããã ãã¦ããã®ã§ãä»åº¦ãããã£ããè¦ãã¦ããããã¦ãã¾ãããããã®ã³ã¡ã³ããè¨é²ã ## ã¡ã¢ãªãµã¤ãºã®èãæ¹ SpringBootã®ã¢ããªãã³ã³ããã¨ãã¦åããå ´åã«ã¯768MB以ä¸å¿ è¦ã§ã1GBãããã¯å²ãå½ã¦ãå¿ è¦ãããã®ã§ã¯ãªããã¨ããåã®ã³ã¡ã³ãã«å¯¾ãã¦ããã ããã³ã¡ã³ãã ããã¯ä¸æ£ç¢º..Tomcatã使ãå ´åã¯æ大ã³ãã¯ã·ã§ã³(ã¹ã¬ãã)ãããã©ã«ã200ã§+50ã¹ã¬ãããããä½è£ãè¦ãã¨250M (-Xss1Mï¼ã§ããã©ã«ãã®ReservervedCodeCacheSize 240Mã¨DirectMemorySize 10Må ããä¸ã«MaxMetaSpaceSizeããã£ãã50Mããã足ãã¨550Mããã使ã£ã¦ããHeapã足ãã¨ã³ã³ãããµã¤ãºâ Toshiaki Maki (@making) November 16, 2019 ãã®åæã§ããã°Heap 2
JVMã«ãã¥ã¼ãã³ã°é ç®ã¯å¤ã ããã©ããããã¯ã·ã§ã³ã§éç¨ããéã«äºããããã¦ããããé ç®ãã¾ã¨ãã¦ã¿ãã¨ã³ããªã§ãã*1 å¿è«ãOSãJVMãããã©ã«ãã§ããç¨åº¦ã®ããã©ã¼ãã³ã¹ã¯çºæ®ã§ããè¨æ¸¬ãä¼´ããªããã¥ã¼ãã³ã°ã¯æªæã§ãããã¨ã¯ããç¥ããã¦ãã¾ãã ããããè¨å®ãã¦ãããªãã¨ããã©ã¼ãã³ã¹ã«ãã®ã¾ã¾å½±é¿ããã¨åãããã®ã調ã¹ãªãã®ã¯è£¸ã§æ¦å ´ã«èµ´ããããªãã®ã§ãã*2 ã©ããªé ç®ãã©ãå¤æ´ããã°è¯ãã®ãç¥ã£ã¦ãããã¨ã¯éè¦ãªæ¦å¨ãªã®ã§ãã ãªã調ã¹ãã®ã ä»åããã¥ã¼ãã³ã°ãã¤ã³ãã調ã¹ãã«ããã£ã¦ãç§ã®ã¢ããã¼ã·ã§ã³ã¯ã©ãã«ããã®ããèããã¨ã以ä¸ã®è¦ä»¶ãæºããããã¨ãããã¨ãããããã¾ãã ã¢ããªã±ã¼ã·ã§ã³ã¨ãã¦æ±ããããå質水æºã¨ãã¦åä½ãã â æ§è½ç®æ¨ ç°å¸¸æã«äºè±¡ã追ããã¨ãã§ãã ããã§ããå質水æºã»ç°å¸¸ã¨ã¯ãããã©ã¼ãã³ã¹ãæããã«ä½ããã¢ããªã±ã¼ã·ã§ã³ãã¯ã©ãã·ã¥ã
Java VMã§ç£è¦ãã¹ã4ã¤ã®ãã¤ã³ã ååã¯ãã·ã¹ãã éç¨è ãJava VMï¼JVMâ ï¼â ãã¢ããªã±ã¼ã·ã§ã³ãµã¼ããJavaã¢ããªã±ã¼ã·ã§ã³ããããã°ãJMXã¨MBeanããã³ãã使ç¨ãã¦æ å ±ãåå¾ããæ¹æ³ãç´¹ä»ãã¾ãããä»åã¨æ¬¡åã§ã¯ãJVMããã©ã®ãããªæ å ±ãæä½éåå¾ããã¹ããã詳細ãç´¹ä»ãã¾ãã ã·ã¹ãã éç¨è ã¯ãJVMãæ»ããªãã¢ããªã±ã¼ã·ã§ã³ãæ¯æ´ã§ãã¦ããããã¢ããªã±ã¼ã·ã§ã³ãåãã¦ãããã確èªããå¿ è¦ãããã¾ããJVMã¯å é¨ã§ç®¡çãã¦ãããã¾ãã¾ãªãªã½ã¼ã¹ã«é¢ããæ å ±ãæã£ã¦ãã¾ãããã·ã¹ãã éç¨è ããããããã¹ã¦ãç£è¦ãããã¨ã¯ä¸å¯è½ã§ããããã§ãããããããæ å ±ã®ä¸ããã次ã®4ã¤ã®ãã¤ã³ãã«çµã£ã¦JVMã®åããç£è¦ãã¾ãã JVMãã¢ããªã±ã¼ã·ã§ã³ãä¸æãããã¨ãªãå®è¡ã§ãã¦ããã JVMãã¢ããªã±ã¼ã·ã§ã³ã®ãªã½ã¼ã¹ã奪ã£ã¦ããªãã OSã®ãªã½ã¼ã¹ãååã«å²ãå½ã¦ã
qiita.com ããã®è©±ããã³ã¡ã«æ¸ããã¨ããã4000åã¯å ¥ããªãã£ãã Microsoft Java VM ãã¤ã¦ã® WIndows ã«ã¯ MS 製㮠Java VM ãæè¼ããã¦ãã¾ããã å¤ä»£ã® Java ã¯ãWrite once, run anywhereããæ²ãã¦ããéããã¯ã©ã¤ã¢ã³ããµã¤ã㧠Java ã¢ãã¬ããã¨ãã¦å©ç¨ãããã®ã主æµã§ããï¼ãµã¼ãã¼ãµã¤ãã§åãããã«ãªã£ã¦ãç価ãçºæ®ããæããããã¾ãï¼ã ããã Java VM ã®ä»æ§ã¯ãããã©ã¼ãã³ã¹ã«ã¤ãã¦ã®è¨è¿°ã¯ææ§ã«ãªã£ã¦ãããOS ãã¨ã®å®è£ ã®éãã«ãã£ã¦ãå®è¡é度ã«é¡èãªå·®ãããã¾ããã Windows ã® Sun ç´æ£ã® Java VM ã¯æ§è½ãæªãã£ããããMS ã¯ç¬èªã® Java VM ãéçºããInternet Explorer ã«ãã³ãã«ãã¾ããã調åã«ä¹ã£ã MS 㯠Windows GUI
ããã«ã¡ã¯ãã¢ããªã±ã¼ã·ã§ã³åºç¤ãã¼ã ã®æ¨ªç°ã§ãã Javaã®è¬ã®ããã©ã¼ãã³ã¹å£åã«ã¾ã¤ãã調æ»ããã¦ããã®ã§ããã1ã¶æã®è¦å´ã®æ«ã«åå ããããã¾ããã®ã§ãå ±åããã¦ããã ãã¾ãï¼ å ¬éå¾ã«é ããã¯ã¦ãªããã¯ãã¼ã¯ã§ã®ãææã»ç¤¾å ã§ã®ã¿ã¤ãã»èªã¿ã«ãããªã©ã®ææãåãã¦ãã®ã§ã謹ãã§ä¿®æ£ããããã ãã¾ãã ä¿®æ£ããå 容ã«ã¤ãã¾ãã¦ã¯ãè¨äºã®æå¾ãåç §ãã¦ãã ããã å¿ãã人ã®ããã®ã¾ã¨ã jdk-7u4以éã®jdk-7 *1 ã§Javaã®ããã©ã¼ãã³ã¹ãå£åããè¬ã®ç¾è±¡ CodeCacheã®å®¹ééçã«è¿ã¥ãã¨JITã³ã³ãã¤ã©ãåæ¢ãã¦ã³ã³ãã¤ã«ããã³ã¼ããæ¨ã¦ãæ©è½ãåå ã ã£ã èµ·åãªãã·ã§ã³ã§åé¿ã§ããã®ã§ãé·æéç¨ããã¨ã㯠-XX:-UseCodeCacheFlushing, -XX:ReservedCodeCacheSize=128m ãã¤ãã ä¸ã®ãªãã·ã§ã³ãè¨å®ããæã«ãC
Java SE 8ã§å°å ¥ãããã©ã ãå¼ã¯ãã©ã®ãããªä»çµã¿ã§å®ç¾ããã¦ããã®ã ãããï¼ ã©ã ãå¼ãããæ·±ãç解ãããã¨èããèªè ã«ã¨ã£ã¦ãããã¯æ°ã«ãªããã¼ãã®1ã¤ã ããããã®ç§å¯ããæããããã Java SE 8ã§å°å ¥ãããã©ã ãå¼ã¯ãJavaã®è¨èªä»æ§ã®æ´å²ã«ããã¦æ大ç´ã®å¤æ´ã ã¨ããã¦ããããã ããããã¯ããã¾ã§ãJavaè¨èªã®ææ³ã¬ãã«ã®è©±ã§ãããJavaããã°ã©ã ãå®è¡ããJavaä»®æ³ãã·ã³ï¼JVMï¼ã«æ°ããªä»çµã¿ãå°å ¥ãããããã§ã¯ãªããã¤ã¾ããè¨èªä»æ§ã«é¢ããæ§ãã¼ã¸ã§ã³ã¨ã®ç¸éã¯ã³ã³ãã¤ã©ã¨ã©ã³ã¿ã¤ã ãå¸åãããã¤ãã³ã¼ãã¬ãã«ã§ã®äºææ§ã¯ä¿ããã¦ããã¨ãããã¨ã ã ããã§ã¯ããã®ãããªå¤§ããªå¤æ´ããæ¢åã®JVMã®ä»çµã¿ã®ä¸ã§ã©ã®ããã«å®ç¾ããã®ã ãããããããç¥ããã¨ã¯ãã©ã ãå¼ãããæ·±ãç解ããæå©ãã¨ãªããããããªããJava SE 8ã®ã©ã ãå¼å®ç¾ã®çµç·¯ã¨ä»çµã¿ã«
The diagram below is the Java Memory Model for the Heap as well as the PermGen for any Java Application running in the Java Virtual Machine (JVM). The ratios are also provided to get a fair understanding of how the distribution of allowed memory is done across each of the generation types. All of the info is completely applicable up to Java 1.7 (inclusive). This diagram is also known as the 'Manag
ä»åãååã®è¨äºã«ã¤ã¥ããJava8ã«ããå¤æ´ç¹ã§æªã ãã¾ãç´¹ä»ããã¦ããªããã¤ã³ããè¨äºã«ãããã¨æãã ä»åã¯Java8ã®HotSpotVMã®è©±ãJava8ã§ã¯JEP122ãåãè¾¼ã¾ããVMã®ã¡ã¢ãªã¢ãã«ãå¤æ´ããããJEP122ã®ã¿ã¤ãã«ãRemove the Permanent Generationãããæ³åã§ããã¨ãããJava8ã®HotSpotVMããã¯å¾æ¥ã®Permanenté åãç¡ããªã£ãã ãªãããããã£ãå¤æ´ãè¡ãããã®ã ãããï¼ã¾ããå ã Permanenté åã«æ ¼ç´ããã¦ããæ å ±ã¯ä½å¦ã«ãã£ã¦ãã¾ã£ãã®ãï¼JVMä»å±ã®ãã¼ã«ã«ã©ããã£ãå½±é¿ãããã®ãï¼ ä»åã®è¨äºã§ã¯ãã®ç¹ãã¾ã¨ãã¦ãããã¨æãã ãªããHotSpotVMã®ã¡ã¢ãªã¢ãã«ã«ã¤ãã¦è©³ãããªãæ¹ã¯ãå ã«ãã¡ãã®é çªï¼ãè£è¶³ â HotSpotVMã®ã¡ã¢ãªæ§é æ¦èª¬ï¼ãèªãã§ããã ãã¨ã¹ã ã¼ãºã«èªã¿é²ããããã
jyukutyo.hatenablog.com ã¨ãããã¨ãè¨ã£ãã®ã§ãScalaã®ã³ã¼ããjavapãããã¨æãã¾ããã ãã¡ããscalacãã¦ããjavapãã¦ãããã®ã§ãããScalaã¯ãªãã¨REPLããjavapã§ããã¨ç¥ãã¾ããã REPL ã§ä½¿ãã :javap ã³ãã³ãã®ãªãã·ã§ã³ã¯ã³ãã³ãã©ã¤ã³ã® javap(1)... - tnoda-scala ãã°ãããè¨äºã ã¨æãã¾ããããããã¨ããããã¾ãï¼ ãªã®ã§ãREPLã§HelloWorldãä½æãã¦javapãããã¨æãã¾ãã scala> object HelloWorldInScala { | def main(args: Array[String]) : Unit = { | printf("Hello World!") | } | } defined object HelloWorldInScala REPLã§ã¯
ãJava News.jpï¼Javaã«é¢ããææ°ãã¥ã¼ã¹ï¼ãã®å®è¤å¹¸å¤®æ°ããCoolãªããã°ã©ãã³ã°ã®ããã®ãã¦ãã¦ãTIPSãçè ã®çµé¨ãªã©ããRundownãï¼é§ã足ã®è¦ç¹èª¬æï¼ã§ãå±ããã¾ãï¼ç·¨éé¨ï¼ æ¨æºJDKã«å«ã¾ãã便å©ãªãã¼ã« èªè ã®çããã¯ãæè¿ã®JDKï¼Java SEï¼ã«ãéçºããããã°ã«ä¾¿å©ãªæ°ãããã¼ã«ãå«ã¾ãã¦ãããã¨ããåãã§ããããï¼ å¤ãããã®Javaéçºè ã¯ãå¤ãæ代ã®JDKã®ãã¼ã«ããç¥ãããä¸æ¹ã§æ°ããJavaéçºè ã¯Eclipse/NetBeansãªã©ã®çµ±åéçºç°å¢ã«æ £ãã¦ãã¾ããç´°ããªã³ãã³ããã¼ã«ãç´ã«ä½¿ãç¶æ³ãæ¸ã£ã¦ãã¦ããããããã¾ããã ããã§ä»åã¯ãæè¿ã®Java SE 6å«ãã¦æ¯è¼çæ°ããã¨æããããã¼ã«ã以ä¸ã®5種é¡ã«åãã¦ç´¹ä»ãã¾ãã ãããã¡ã¤ãªã³ã° ãã©ãã«ã·ã¥ã¼ãã£ã³ã°ï¼æ å ±åå¾ ç£è¦ é åï¼è£å© ã¹ã¯ãªããã£ã³ã° ããããªãã¼
13. jstat ⢠PC/PUãMC/MU,CCSC/CCSUã«å¤æ´ããã¦ãã Java7 $ /usr/java/jdk8/bin/jstat -gc 6516 S0C S1C S0U S1U EC EU OC OU PC PU (ç¥) 2560.0 2560.0 0.0 0.0 30720.0 317.5 36864.0 15032.1 28672.0 14250.7 (ç¥) Java8 $ /usr/java/jdk8/bin/jstat -gc 15802 S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU (ç¥) 4096.0 4096.0 0.0 0.0 32768.0 368.8 14336.0 11029.2 15104.0 14456.5 1792.0 1597.2
2010-07-16 Java: å ¬å¼ãµã¤ããå¼è¶ãä¸ prog Java ã®éçºè åãå ¬å¼ãµã¤ãã¯ããã¾ã§ http://java.sun.com ã¨ãã URL ã§éå¶ããã¦ãããã7 æä¸ã« Oracle ã®ãµã¤ãã¸å¼ã£è¶ãããããæ°ãã URL 㯠http://www.oracle.com/technetwork/java/index.html ã«ãªãããã§ã«ããããã¼ã¸ã¯åå¨ãã¦ããã 2010-07-16 Java: PermGen ã¯ãã¼ãã®å¤ prog ä»é ç¥ã£ããPermGen ãæ®éã«ãã¼ãå ã ã¨æã£ã¦ã¾ããã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}