锘??xml version="1.0" encoding="utf-8" standalone="yes"?>岛国成人av,免费电影网站在线视频观看福利 ,欧美在线影院http://www.aygfsteel.com/paulwong/category/55341.htmlzh-cnMon, 24 Feb 2020 17:28:03 GMTMon, 24 Feb 2020 17:28:03 GMT60鍚勭鑾峰彇JVM DUMP鐨勬柟娉?/title><link>http://www.aygfsteel.com/paulwong/archive/2020/02/24/435157.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Mon, 24 Feb 2020 14:03:00 GMT</pubDate><guid>http://www.aygfsteel.com/paulwong/archive/2020/02/24/435157.html</guid><wfw:comment>http://www.aygfsteel.com/paulwong/comments/435157.html</wfw:comment><comments>http://www.aygfsteel.com/paulwong/archive/2020/02/24/435157.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/paulwong/comments/commentRss/435157.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/paulwong/services/trackbacks/435157.html</trackback:ping><description><![CDATA[<p style="font-size: medium; font-family: "Times New Roman";">JVM 鐨勭嚎紼嬪爢鏍?dump 涔熺О core dump錛屽唴瀹逛負鏂囨湰錛屼富瑕佸寘鍚綋鏃?JVM 鐨勭嚎紼嬪爢鏍堬紝鍫?dump 涔熺О heap dump錛屽唴瀹逛負浜岃繘鍒舵牸寮忥紝涓昏鍖呭惈褰撴椂 JVM 鍫嗗唴瀛樹腑鐨勫唴瀹廣傜敱浜庡悇涓搷浣滅郴緇熴佸悇涓?JVM 瀹炵幇涓嶅悓錛屽嵆浣垮悓涓 JVM 瀹炵幇錛屽悇涓増鏈篃鏈夊樊寮傦紝鏈枃鎻忚堪鐨勬柟娉曢兘鍩轟簬 64 浣?Linux 鎿嶄綔緋葷粺鐜錛孞ava 8 Oracle HotSpot JVM 瀹炵幇銆?/p><p style="font-size: medium; font-family: "Times New Roman";">鍫嗘爤鍜屽爢鐨勫唴瀹瑰湪瀹氫綅闂鐨勬椂鍊欙紝閮芥槸闈炲父閲嶈鐨勪俊鎭傜嚎紼嬪爢鏍?dump 鍙互浜嗚В褰撴椂 JVM 涓墍鏈夌嚎紼嬬殑榪愯鎯呭喌錛屾瘮濡傜嚎紼嬬殑鐘舵佸拰褰撳墠姝e湪榪愯鐨勪唬鐮佽銆傚爢 dump 鍙互浜嗚В褰撴椂鍫嗙殑浣跨敤鎯呭喌錛屽悇涓被瀹炰緥鐨勬暟閲忓強鍚勪釜瀹炰緥鎵鍗犵敤鐨勭┖闂村ぇ灝忋?/p><h1>綰跨▼鍫嗘爤</h1><h2>浣跨敤 jstack</h2><p style="font-size: medium; font-family: "Times New Roman";">jstack 鏄?JDK 鑷甫鐨勫伐鍏鳳紝鐢ㄤ簬 dump 鎸囧畾榪涚▼ ID(PID)鐨?JVM 鐨勭嚎紼嬪爢鏍堜俊鎭?/p><div highlighter-rouge"="" style="font-size: medium; font-family: "Times New Roman";"><pre><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--># 鎵撳嵃鍫嗘爤淇℃伅鍒版爣鍑嗚緭鍑?nbsp;jstack PID  <br /># 鎵撳嵃鍫嗘爤淇℃伅鍒版爣鍑嗚緭鍑猴紝浼氭墦鍗板叧浜庨攣鐨勪俊鎭?nbsp;jstack -l PID  <br />寮哄埗鎵撳嵃鍫嗘爤淇℃伅鍒版爣鍑嗚緭鍑猴紝濡傛灉浣跨敤 jstack PID 娌℃湁鍝嶅簲鐨勬儏鍐典笅(姝ゆ椂 JVM 榪涚▼鍙兘鎸傝搗)錛?br />鍔?nbsp;-F 鍙傛暟 jstack -F PID </div></pre></div><h2>浣跨敤 jcmd</h2><p style="font-size: medium; font-family: "Times New Roman";">jcmd 鏄?JDK 鑷甫鐨勫伐鍏鳳紝鐢ㄤ簬鍚?JVM 榪涚▼鍙戦佸懡浠わ紝鏍規嵁鍛戒護鐨勪笉鍚岋紝鍙互浠f浛鎴栭儴鍒嗕唬鏇?jstack銆乯map 絳夈傚彲浠ュ彂閫佸懡浠?nbsp;<code>Thread.print</code> 鏉ユ墦鍗板嚭 JVM 鐨勭嚎紼嬪爢鏍堜俊鎭?/p><div highlighter-rouge"="" style="font-size: medium; font-family: "Times New Roman";"><pre><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--># 涓嬮潰鐨勫懡浠ゅ悓絳変簬 jstack PID <br />jcmd PID Thread.print  <br /><br /># 鍚岀瓑浜?nbsp;jstack -l PID <br />jcmd PID Thread.print -l </div></pre></div><h2>浣跨敤 kill -3</h2><p style="font-size: medium; font-family: "Times New Roman";">kill 鍙互鍚戠壒瀹氱殑榪涚▼鍙戦佷俊鍙?SIGNAL)錛岀己鐪佹儏鍐墊槸鍙戦佺粓姝?TERM) 鐨勪俊鍙?錛屽嵆 kill PID 涓?kill -15 PID 鎴?kill -TERM PID 鏄瓑浠風殑銆侸VM 榪涚▼浼氱洃鍚?QUIT 淇″彿(鍏跺間負 3)錛屽綋鏀跺埌榪欎釜淇″彿鏃訛紝浼氭墦鍗板嚭褰撴椂鐨勭嚎紼嬪爢鏍堝拰鍫嗗唴瀛樹嬌鐢ㄦ瑕侊紝鐩告瘮 jstack錛屾鏃跺浜嗗爢鍐呭瓨鐨勪嬌鐢ㄦ瑕佹儏鍐點備絾 jstack 鍙互鎸囧畾 -l 鍙傛暟錛屾墦鍗伴攣鐨勪俊鎭?/p><div highlighter-rouge"="" style="font-size: medium; font-family: "Times New Roman";"><pre><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->kill -3 PID <br /># 鎴?nbsp;kill -QUIT PID </div></pre></div><h1>鍫?/h1><h2>-XX:+HeapDumpOnOutOfMemoryError</h2><p style="font-size: medium; font-family: "Times New Roman";">娣誨姞 JVM 鍙傛暟 -XX:+HeapDumpOnOutOfMemoryError 鍚庯紝褰撳彂鐢?OOM(OutOfMemory)鏃訛紝鑷姩鍫?dump銆傜己鐪佹儏鍐典笅錛孞VM 浼氬垱寤轟竴涓悕縐頒負 java_pidPID.hprof 鐨勫爢 dump 鏂囦歡鍦?JVM 鐨勫伐浣滅洰褰曚笅銆備絾鍙互浣跨敤鍙傛暟 -XX:HeapDumpPath=PATH 鏉ユ寚瀹?dump 鏂囦歡鐨勪繚瀛樹綅緗?/p><div highlighter-rouge"="" style="font-size: medium; font-family: "Times New Roman";"><pre><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--># JVM 鍙戠敓 OOM 鏃訛紝浼氳嚜鍔ㄥ湪 /var/log/abc 鐩綍涓嬩駭鐢熷爢 dump 鏂囦歡 java_pidPID.hprof <br />java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/abc/ </div></pre></div><h2>jmap</h2><p style="font-size: medium; font-family: "Times New Roman";">jmap 涔熸槸 JDK 鑷甫鐨勫伐鍏鳳紝涓昏鐢ㄤ簬鑾峰彇鍫嗙浉鍏崇殑淇℃伅銆?/p><h3>鍫?dump</h3><div highlighter-rouge"="" style="font-size: medium; font-family: "Times New Roman";"><pre><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--># 灝?nbsp;JVM 鐨勫爢 dump 鍒版寚瀹氭枃浠訛紝濡傛灉鍫嗕腑瀵硅薄杈冨錛岄渶瑕佺殑鏃墮棿浼氳緝闀匡紝瀛愬弬鏁?nbsp;format 鍙敮鎸?nbsp;b錛?br />鍗充簩榪涘埗鏍煎紡<br />jmap -dump:format=b,file=FILE_WITH_PATH<br /><br /># 濡傛灉 JVM 榪涚▼鏈搷搴斿懡浠わ紝鍙互鍔犱笂鍙傛暟 -F 灝濊瘯<br />jmap -F -dump:format=b,file=FILE_WITH_PATH<br /><br /># 鍙互鍙?nbsp;dump 鍫嗕腑鐨勫瓨媧誨璞★紝鍔犱笂 live 瀛愬弬鏁幫紝浣嗕嬌鐢?nbsp;-F 鏃朵笉鏀寔 live<br />jmap -dump:live,format=b,file=FILE_WITH_PATH</div></pre></div><h3>鑾峰彇鍫嗘瑕佷俊鎭?/h3><div highlighter-rouge"="" style="font-size: medium; font-family: "Times New Roman";"><pre><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--># -heap 鍙傛暟鐢ㄤ簬鏌ョ湅鎸囧畾 JVM 榪涚▼鐨勫爢鐨勪俊鎭紝鍖呮嫭鍫嗙殑鍚勪釜鍙傛暟鐨勫鹼紝鍫嗕腑鏂扮敓浠c佸勾鑰佷唬鐨勫唴瀛樺ぇ灝忋佷嬌鐢ㄧ巼絳?nbsp;<br />jmap -heap PID  <br /><br /># 鍚屾牱錛屽鏋?nbsp;JVM 榪涚▼鏈搷搴斿懡浠わ紝鍙互鍔犱笂鍙傛暟 -F 灝濊瘯 <br />jmap -F -heap PID </div></pre></div><p style="font-size: medium; font-family: "Times New Roman";">涓涓疄渚嬭緭鍑哄涓嬶細</p><div style="font-size: medium; font-family: "Times New Roman";"><pre><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->Attaching to process ID 68322, please wait<img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /><br />Debugger attached successfully.<br />Server compiler detected.<br />JVM version is 25.112-b16<br /><br />using thread-local object allocation.<br />Parallel GC with 4 thread(s)<br /><br />Heap Configuration:<br />   MinHeapFreeRatio         = 0<br />   MaxHeapFreeRatio         = 100<br />   MaxHeapSize              = 268435456 (256.0MB)<br />   NewSize                  = 8388608 (8.0MB)<br />   MaxNewSize               = 89128960 (85.0MB)<br />   OldSize                  = 16777216 (16.0MB)<br />   NewRatio                 = 2<br />   SurvivorRatio            = 8<br />   MetaspaceSize            = 21807104 (20.796875MB)<br />   CompressedClassSpaceSize = 1073741824 (1024.0MB)<br />   MaxMetaspaceSize         = 17592186044415 MB<br />   G1HeapRegionSize         = 0 (0.0MB)<br /><br />Heap Usage:<br />PS Young Generation<br />Eden Space:<br />   capacity = 41943040 (40.0MB)<br />   used     = 1701504 (1.6226806640625MB)<br />   free     = 40241536 (38.3773193359375MB)<br />   4.05670166015625% used<br />From Space:<br />   capacity = 4194304 (4.0MB)<br />   used     = 0 (0.0MB)<br />   free     = 4194304 (4.0MB)<br />   0.0% used<br />To Space:<br />   capacity = 5242880 (5.0MB)<br />   used     = 0 (0.0MB)<br />   free     = 5242880 (5.0MB)<br />   0.0% used<br />PS Old Generation<br />   capacity = 30408704 (29.0MB)<br />   used     = 12129856 (11.56793212890625MB)<br />   free     = 18278848 (17.43206787109375MB)<br />   39.889421134159484% used<br /><br />16658 interned Strings occupying 1428472 bytes.</div><span style="font-family: verdana, "courier new"; font-size: 14px;"><br />鑾峰彇鍫嗕腑鐨勭被瀹炰緥緇熻</span></pre></div><div highlighter-rouge"="" style="font-size: medium; font-family: "Times New Roman";"><pre><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--># 鎵撳嵃 JVM 鍫嗕腑鐨勭被瀹炰緥緇熻淇℃伅錛屼互鍗犵敤鍐呭瓨鐨勫ぇ灝忔帓搴忥紝鍚屾牱錛屽鏋?nbsp;JVM 鏈搷搴斿懡浠わ紝涔熷彲浠ヤ嬌鐢?nbsp;-F 鍙傛暟 <br />jmap -histo PID  <br /><br /># 涔熷彲浠ュ彧緇熻鍫嗕腑鐨勫瓨媧誨璞★紝鍔犱笂 live 瀛愬弬鏁幫紝浣嗕嬌鐢?nbsp;-F 鏃朵笉鏀寔 live <br />jmap -histo:live PID </div></pre></div><h2>浣跨敤 jcmd</h2><div highlighter-rouge"="" style="font-size: medium; font-family: "Times New Roman";"><pre><div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--># 絳夊悓 jmap -dump:live,format=b,file=FILE_WITH_PATH<br />jcmd PID GC.heap_dump FILE_WITH_PATH<br /><br /># 絳夊悓 jmap -dump:format=b,file=FILE_WITH_PATH<br />jcmd PID GC.heap_dump -all FILE_WITH_PATH<br /><br /># 絳夊悓 jmap -histo:live PID<br />jcmd PID GC.class_histogram<br /><br /># 絳夊悓 jmap -histo PID<br />jcmd PID GC.class_histogram -all</div></pre></div><img src ="http://www.aygfsteel.com/paulwong/aggbug/435157.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/paulwong/" target="_blank">paulwong</a> 2020-02-24 22:03 <a href="http://www.aygfsteel.com/paulwong/archive/2020/02/24/435157.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>!!21 MOST IMPORTANT JAVA 8 VM OPTIONS FOR SERVERShttp://www.aygfsteel.com/paulwong/archive/2020/02/16/435118.htmlpaulwongpaulwongSun, 16 Feb 2020 14:30:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/02/16/435118.htmlhttp://www.aygfsteel.com/paulwong/comments/435118.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/02/16/435118.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435118.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435118.html


In this video I explain some 21 JVM parameters which are suited for most server applications. If you have any questions, you can read those links below for more information or just ask in the comments section.

Java server flags video

I run several Java enterprise server applications. I often wondered – what are the best „default“ JVM settings for a server application to start with in production? I read a lot on the web and tried several things myself and wanted to share what I found out, so far. Links containing more information about JVM optimization can be found here:

http://blog.sokolenko.me/2014/11/javavm-options-production.html

http://www.petefreitag.com/articles/gctuning/

http://stas-blogspot.blogspot.de/2011/07/most-complete-list-of-xx-options-for.html

 

So let’s start:

-server

Use „-server“: All 64-bit JVMs use the server VM as default anyway. This setting generally optimizes the JVM for long running server applications instead of startup time. The JVM will collect more data about the Java byte code during program execution and generate the most efficient machine code via JIT.

-Xms=<heap size>[g|m|k] -Xmx=<heap size>[g|m|k]

The „-Xmx/-Xms“ settings specify the maximum and minimum values for the JVM heap memory. For servers, both params should have the same value to avoid heap resizing during runtime. I’ve applications running with 16GB heap sizes without an issue.

Depending on your application, you will have to try out how much memory will be best suited for your use case.

-XX:MaxMetaspaceSize=<metaspace size>[g|m|k]

Java 8 has no „Permanent Generation“ (PermGen) anymore but requires additional „Metaspace“ memory instead. This memory is used, in addition to the heap memory we specified before, for storing class meta data information.

The default size will be unlimited – I tend to limit MaxMetaspaceSize with a somewhat high value. Just in case something goes wrong with the application, the JVM will not hog all the memory of the server.

I suggest: Let your application run for a couple of days to get a feeling for how much Metaspace Size it uses normally. Upon next restart of the application set the limit to e.g. double the value.

-XX:+CMSClassUnloadingEnabled

Additionally, you might want to allow the JVM to unload classes which are held in memory but no code is pointing to them any more. If your application generates lots of dynamic classes, this is what you want.

-XX:+UseConcMarkSweepGC

This option makes the JVM use the ConcurrentMarkSweepGC – It can do much work in parallel to program execution but in some circumstances a „full GC“ with a „STW pause“ might still occur. I’ve read many articles and came to the conclusion that this GC is still the best one for server workloads.

-XX:+CMSParallelRemarkEnabled

The option CMSParallelRemarkEnabled means the remarking is done in parallel to program execution – which is what you want if your server has many cores (and most servers do).

 -XX:+UseCMSInitiatingOccupancyOnly  -XX:CMSInitiatingOccupancyFraction=<percent>

Normally the GC will use heuristics to know when it’s time to clear memory. GC might kick in too late with default settings (causing full-Gcs).
Some sources say it might be a good idea to disable heuristics altogether and just use generation occupancy to start a CMS collection cycle. Setting values around 70% worked fine for all of my applications and use cases.

-XX:+ScavengeBeforeFullGC

The first option tells the GC to first free memory by clearing out the „young generation“ or fairly new objects before doing a full GC.

-XX:+CMSScavengeBeforeRemark

CMSScavengeBeforeRemark does attempt a minor collection before the CMS remark phase – thus keeping the remark pause afterwards short.

-XX:+CMSClassUnloadingEnabled

The option „-XX:+CMSClassUnloadingEnabled“ here tells the JVM to unload classes, which are not needed any more by the running application. If you deploy war files to an application server like wildfly, tomcat or glassfish without restarting the server after the deployment, this flag is for you.

-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses

The option „-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses“ is especially important if your application uses RMI (remote method invocation). The usage of RMI will cause the JVM to do a FULL-GC EVERY HOUR! This might be a very bad idea for large heap sizes because the FULL-GC pause might take up to several seconds. It would be better to do a concurrent GC and try to unload unused classes to free up more memory – which is exactly what the second option does.

-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:"<path to log>"

These options shown here will write out all GC related information to a specified log file. You can see how well your GC configuration works by looking into it.

I personally prefer to use the „Visual GC“ plug in for the „Visual VM“ tool to monitor the general JVM and GC behavior.

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=<path to dump>`date`.hprof

When your JVM runs out of memory, you will want to know why. Since the OOM error might be hard to reproduce and you want to get your production server up and running again – you should specify a path for a heap dump. When things have settled down, you can analyze the dump afterwards.

-Djava.rmi.server.hostname=<external IP> -Dcom.sun.management.jmxremote.port=<port>

These options will help you to specify an IP and port for JMX – you will need those ports open to connect remotely to a JVM running on a server for tools like VisualVM. You can gain deep insights over cpu and memory usage, gc behaviour, class loading, thread count and usage of your application this way.

Visual VM
Lastly, I would like to recommend to you the VisualVM tool which is bundled with the Java 8 JDK. You can use it to gain more insights about your specific application behaviour on the JVM – like cpu and memory usage, thread utilisation and much more.

Visual GCVisualVM can be extended with a plug in called „Visual GC“. It will briefly show you VERY detailed information about the usage of the young and old generation object spaces. You can easily spot problems with garbage collection simply by analyzing these graphs during application runtime.

Thank you very much for watching! If you liked the video you might consider giving it a „thumbs up“. If you have any questions – just put them in the comments section. I will reply as quickly as possible.

-------------------------------------------------------

-XX:+UseCompressedOops [If Max Heap allocation is less than 32GB]
This can save a significant amount of memory and this option should already be enabled by default on recent java 8 versions. This option allowes object references to be stored as 32-bit values instead of 64-bit on 64-bit JVMs. This leads to before mentioned memory savings.

-XX:+AggressiveOpts
This option will enable performance options which are hoped to become enabled by default in upcoming released of the JVM. This option sets some performance settings but is marked as experimental! So you should only enable it, when you have to possibility to test your application thoroughly before enabling this flag on an production server.

-XX:+UseStringDeduplication
Since Java 8 update 20 you can use this option to reduce the memory usage of your application. The JVM will spot identical strings in memory, remove the duplicated and point all references to the remaining, single instance of the string.

-XX:+UseG1GC
Will tell the JVM to use the most recent G1 garbage collector. You are trading better application response times (due to shorter gc times with G1) against lower throughput (compared against good old ConcMarkSweepGC / CMS). If your application can deliver more value through short gc times, then G1 is definately better suited. Otherwise on Java 8, I’d recommend sticking with CMS.

Concerning your Tomcat 8 question, I’d suggest you have a look into it with the „VisualVM“ tool. Look at memory usage, GC times (visual GC plugin), pull and analyse stack traces or thread dumps to find the weak spot. You might also consider attaching a debugger to tomcat to find the bug.



https://www.maknesium.de/21-most-important-java-8-vm-options-for-servers



paulwong 2020-02-16 22:30 鍙戣〃璇勮
]]>
Guide to the Most Important JVM Parametershttp://www.aygfsteel.com/paulwong/archive/2019/08/01/434330.htmlpaulwongpaulwongThu, 01 Aug 2019 08:55:00 GMThttp://www.aygfsteel.com/paulwong/archive/2019/08/01/434330.htmlhttp://www.aygfsteel.com/paulwong/comments/434330.htmlhttp://www.aygfsteel.com/paulwong/archive/2019/08/01/434330.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/434330.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/434330.htmlhttps://www.baeldung.com/jvm-parametersa

Optimising Your Minecraft: Jvm Arguments
https://xealgaming.net/threads/optimising-your-minecraft-jvm-arguments.4758/


paulwong 2019-08-01 16:55 鍙戣〃璇勮
]]>
JVM鍐呭瓨閰嶇疆http://www.aygfsteel.com/paulwong/archive/2019/08/01/434329.htmlpaulwongpaulwongThu, 01 Aug 2019 08:44:00 GMThttp://www.aygfsteel.com/paulwong/archive/2019/08/01/434329.htmlhttp://www.aygfsteel.com/paulwong/comments/434329.htmlhttp://www.aygfsteel.com/paulwong/archive/2019/08/01/434329.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/434329.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/434329.htmlJVM鍐呭瓨涓昏鍒嗕負涓や釜閮ㄥ垎錛屽垎鍒槸PermanentSapce鍜孒eapSpace銆?/p>

PermantSpace涓昏璐熻矗瀛樻斁鍔犺澆鐨?a style="color: #075db3;">Class綾葷駭瀵硅薄濡俢lass鏈韓錛?a style="color: #075db3;">method錛宖ield絳夊弽灝勫璞★紝涓鑸笉鐢ㄩ厤緗?/p>

JVM鐨凥eap鍖哄彲浠ラ氳繃-X鍙傛暟鏉ヨ瀹氥侶eapSpace= {Old + NEW {= Eden , from, to } }

褰撲竴涓猆RL琚闂椂錛屽唴瀛樼敵璇瘋繃紼嬪涓嬶細

  1. JVM浼氳瘯鍥句負鐩稿叧Java瀵硅薄鍦‥den涓垵濮嬪寲涓鍧楀唴瀛樺尯鍩?nbsp;
  2. 褰揈den絀洪棿瓚沖鏃訛紝鍐呭瓨鐢寵緇撴潫銆傚惁鍒欏埌涓嬩竴姝?nbsp;
  3. JVM璇曞浘閲婃斁鍦‥den涓墍鏈変笉媧昏穬鐨勫璞★紙榪欏睘浜?鎴栨洿楂樼駭鐨勫瀮鍦懼洖鏀訛級, 閲婃斁鍚庤嫢Eden絀洪棿浠嶇劧涓嶈凍浠ユ斁鍏ユ柊瀵硅薄錛屽垯璇曞浘灝嗛儴鍒咵den涓椿璺冨璞℃斁鍏urvivor鍖?/li>
  4.  Survivor鍖鴻鐢ㄦ潵浣滀負Eden鍙奜LD鐨勪腑闂翠氦鎹㈠尯鍩燂紝褰揙LD鍖虹┖闂磋凍澶熸椂錛孲urvivor鍖虹殑瀵硅薄浼氳縐誨埌Old鍖猴紝鍚﹀垯浼氳淇濈暀鍦⊿urvivor鍖?nbsp;
  5. 褰揙LD鍖虹┖闂翠笉澶熸椂錛孞VM浼氬湪OLD鍖鴻繘琛屽畬鍏ㄧ殑鍨冨溇鏀墮泦錛?綰э級 
  6. 瀹屽叏鍨冨溇鏀墮泦鍚庯紝鑻urvivor鍙奜LD鍖轟粛鐒舵棤娉曞瓨鏀句粠Eden澶嶅埗榪囨潵鐨勯儴鍒嗗璞★紝瀵艱嚧JVM鏃犳硶鍦‥den鍖轟負鏂板璞″垱寤哄唴瀛樺尯鍩燂紝鍒欏嚭鐜?#8221;out of memory閿欒”

Xms/Xmx錛氬畾涔塏EW+OLD孌電殑鎬誨昂瀵革紝ms涓篔VM鍚姩鏃禢EW+OLD鐨勫唴瀛樺ぇ灝忥紱mx涓烘渶澶у彲鍗犵敤鐨凬EW+OLD鍐呭瓨澶у皬銆傘傚湪鐢ㄦ埛鐢熶駭鐜涓婁竴鑸皢榪欎袱涓艱涓虹浉鍚岋紝浠ュ噺灝戣繍琛屾湡闂寸郴緇熷湪鍐呭瓨鐢寵涓婃墍鑺辯殑寮閿錛?nbsp;

NewSize/MaxNewSize錛氬畾涔夊崟鐙琋EW孌電殑灝哄錛孨ewSize涓篔VM鍚姩鏃禢EW鐨勫唴瀛樺ぇ灝忥紱MaxNewSize涓烘渶澶у彲鍗犵敤鐨凬EW鐨勫唴瀛樺ぇ灝忋傚湪鐢ㄦ埛鐢熶駭鐜涓婁竴鑸皢榪欎袱涓艱涓虹浉鍚岋紝浠ュ噺灝戣繍琛屾湡闂寸郴緇熷湪鍐呭瓨鐢寵涓婃墍鑺辯殑寮閿錛?/span>

Xms/Xmx鍜孨ewSize/MaxNewSize瀹氫箟濂藉悗錛孫LD鍖洪棿涔熻嚜鐒跺畾涔夊畬姣曚簡錛屽嵆OLD鍖哄垵濮嬪ぇ灝?錛圶ms-NewSize錛夛紝OLD鍖烘渶澶у彲鍗犵敤澶у皬=錛圶mx-MaxNewSize錛夛紱 

PermSize/MaxPermSize錛氬畾涔塒erm孌電殑灝哄錛孭ermSize涓篔VM鍚姩鏃禤erm鐨勫唴瀛樺ぇ灝忥紱MaxPermSize涓烘渶澶у彲鍗犵敤鐨凱erm鍐呭瓨澶у皬銆傚湪鐢ㄦ埛鐢熶駭鐜涓婁竴鑸皢榪欎袱涓艱涓虹浉鍚岋紝浠ュ噺灝戣繍琛屾湡闂寸郴緇熷湪鍐呭瓨鐢寵涓婃墍鑺辯殑寮閿銆?/span>



paulwong 2019-08-01 16:44 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 静安区| 南充市| 新宾| 龙胜| 玛纳斯县| 沧源| 北流市| 中牟县| 常山县| 长宁县| 深州市| 万年县| 宜良县| 定陶县| 阜阳市| 南召县| 德安县| 合江县| 深圳市| 元阳县| 澄城县| 鹤庆县| 宁远县| 宁蒗| 台北县| 榆林市| 仁寿县| 信阳市| 三江| 漯河市| 葫芦岛市| 鹿泉市| 苗栗县| 阿瓦提县| 延吉市| 兴仁县| 宁化县| 玉溪市| 仲巴县| 营口市| 泰宁县|